Commanded v0.19.1 Commanded.Registration behaviour View Source
Defines a behaviour for a process registry to be used by Commanded.
By default, Commanded will use a local process registry, defined in
Commanded.Registration.LocalRegistry
, that uses Elixir's Registry
module
for local process registration. This limits Commanded to only run on a single
node. However the Commanded.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
Functions
Allow a registry provider to handle the standard GenServer
callback
functions
Use the Commanded.Registration
module to import the registry provider and
via tuple functions.
Get the configured process registry.
Callbacks
Return an optional supervisor spec for the registry
Starts a uniquely named child process of a supervisor using the given module and args.
Starts a uniquely named GenServer
process for the given module and args.
Use to start a supervisor.
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 Functions
Allow a registry provider to handle the standard GenServer
callback
functions
Use the Commanded.Registration
module to import the registry provider and
via tuple functions.
Get the configured process registry.
Defaults to a local registry, restricted to running on a single node.
Link to this section Callbacks
Return an optional supervisor spec for the registry
start_child(name, supervisor, child_spec)
View Sourcestart_child( name :: term(), supervisor :: module(), child_spec :: start_child_arg() ) :: {:ok, pid()} | {:error, term()}
Starts a uniquely named child process of a supervisor using the given module and args.
Registers the pid with the given name.
Starts a uniquely named GenServer
process for the given module and args.
Registers the pid with the given name.
supervisor_child_spec(module, arg)
View Sourcesupervisor_child_spec(module :: atom(), arg :: any()) :: :supervisor.child_spec()
Use to start a supervisor.
Return a :via
tuple to route a message to a process by its registered name
Get the pid of a registered name.
Returns :undefined
if the name is unregistered.