EventStore v0.12.0 EventStore.Registration behaviour View Source

Process registry specification

Link to this section Summary

Functions

Allow a registry provider to handle the standard GenServer callback functions

Use the EventStore.Registration module to import the registry_provider/0 and via_tuple/1 functions

Get the configured registry provider, defaults to :local if not configured

Callbacks

Return an optional supervisor spec for the registry

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 Functions

Link to this macro __before_compile__(env) View Source (macro)

Allow a registry provider to handle the standard GenServer callback functions

Use the EventStore.Registration module to import the registry_provider/0 and via_tuple/1 functions.

Get the configured registry provider, defaults to :local if not configured

Link to this function start_child(name, supervisor, args) View Source

Link to this section Callbacks

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

Return an optional supervisor spec for the registry

Link to this callback publish_events(stream_uuid, events) View Source
publish_events(stream_uuid :: term(), events :: [EventStore.RecordedEvent.t()]) :: :ok

Publish events to any EventStore.Publisher process

Link to this callback start_child(name, supervisor, args) View Source
start_child(name :: term(), supervisor :: module(), args :: [any()]) ::
  {:ok, pid()} |
  {:error, reason :: term()}
start_child(name :: term(), supervisor :: module(), args :: [any()]) ::
  {:ok, pid()} |
  {:error, reason :: term()}
Link to this callback 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 callback whereis_name(name) View Source
whereis_name(name :: term()) :: pid() | :undefined

Get the pid of a registered name.

Returns :undefined if the name is unregistered.