View Source WorkflowMetal.Registration.Adapter behaviour (workflow_metal v0.2.1)
Defines a behaviour for a process registry to be used by WorkflowMetal.
By default, WorkflowMetal will use a local process registry, defined in
WorkflowMetal.Registration.LocalRegistry
, that uses Elixir's Registry
module
for local process registration. This limits WorkflowMetal to only run on a single
node. However the WorkflowMetal.Registration
behaviour can be implemented by a
library to provide distributed process registration to support running on a
cluster of nodes.
Link to this section Summary
Callbacks
Return a supervisor spec for the registry
Start a child under a DynamicSupervisor. If a child with give name already exists, find its pid.
Return a :via
tuple to route a message to a process by its registered name
Get the pid of a registered name.
Link to this section Types
Link to this section Callbacks
Specs
child_spec(application(), config()) :: {:ok, :supervisor.child_spec() | {module(), term()} | module(), adapter_meta()}
Return a supervisor spec for the registry
Specs
start_child( adapter_meta :: adapter_meta(), name :: term(), supervisor :: Supervisor.supervisor(), child_spec :: child_spec() ) :: on_start_child()
Start a child under a DynamicSupervisor. If a child with give name already exists, find its pid.
Specs
via_tuple(adapter_meta :: adapter_meta(), name :: term()) :: {:via, module(), term()}
Return a :via
tuple to route a message to a process by its registered name
Specs
whereis_name(adapter_meta(), name :: term()) :: pid() | :undefined
Get the pid of a registered name.
Returns :undefined
if the name is unregistered.