EventStore v0.13.2 EventStore.Registration.DistributedRegistry behaviour View Source

Process registration and distribution throughout a cluster of nodes using Swarm

Link to this section Summary

Functions

Return an optional supervisor spec for the registry

Starts a uniquely named child process of a supervisor using the given module and args

Return a :via tuple to route a message to a process by its registered name

Get the pid of a registered name

Callbacks

Sends a message to the given dest running on the current node and each connected node, returning :ok

Link to this section Functions

Link to this function child_spec() View Source
child_spec() :: [:supervisor.child_spec()]

Return an optional supervisor spec for the registry

Link to this function start_child(name, supervisor, args) View Source
start_child(name :: term(), supervisor :: module(), args :: [any()]) ::
  {:ok, pid()} |
  {:error, reason :: term()}

Starts a uniquely named child process of a supervisor using the given module and args.

Registers the pid with the given name.

Link to this function via_tuple(name) View Source
via_tuple(name :: term()) :: {:via, module(), name :: term()}

Return a :via tuple to route a message to a process by its registered name

Link to this function whereis_name(name) View Source
whereis_name(name :: term()) :: pid() | :undefined

Get the pid of a registered name.

Link to this section Callbacks

Link to this callback multi_send(dest, message) View Source
multi_send(dest :: atom(), message :: any()) :: :ok

Sends a message to the given dest running on the current node and each connected node, returning :ok.