BB.Process (bb v0.15.0)
View SourceHelper functions for building child specs and looking up processes in the robot's registry.
Summary
Functions
Build a child_spec for a bridge process.
Call a process looked up by name.
Cast a message to a process looked up by name.
Build a child_spec that registers the process in the robot's registry.
Returns the registry name for a robot module.
Send a raw message to a process looked up by name.
Build a :via tuple for registry lookup by name.
Look up a process by name in the robot's registry.
Types
Functions
Build a child_spec for a bridge process.
Bridges use GenServer directly (not a wrapper) as they implement the full GenServer behaviour themselves.
Call a process looked up by name.
Uses a :via tuple so the registry handles lookup atomically.
Raises if the process doesn't exist or times out.
Cast a message to a process looked up by name.
Uses a :via tuple so the registry handles lookup atomically.
Returns :ok (GenServer.cast always returns :ok, even if process doesn't exist).
@spec child_spec( module(), atom(), module() | {module(), Keyword.t()}, [atom()], process_type(), Keyword.t() ) :: map()
Build a child_spec that registers the process in the robot's registry.
The resulting child spec uses the appropriate wrapper GenServer based on type:
:actuator→BB.Actuator.Server(orBB.Sim.Actuatorin simulation mode):sensor→BB.Sensor.Server:controller→BB.Controller.Server
The user's callback module is passed via __callback_module__ and the wrapper
server delegates GenServer callbacks to it.
The process is registered by its name (which must be globally unique across the robot). The full path is passed to the process in its init args for context, but is not used for registration.
Options
:simulation- when set (e.g.,:kinematic), actuators useBB.Sim.Actuatorinstead of the real actuator module
Returns the registry name for a robot module.
Send a raw message to a process looked up by name.
Uses Registry.dispatch/3 to handle lookup atomically.
Returns :ok regardless of whether the process exists.
Build a :via tuple for registry lookup by name.
Look up a process by name in the robot's registry.
Returns pid if found, :undefined otherwise.