View Source Elsa.ElsaRegistry (Elsa.fi v2.0.2)

Implements a custom version of the Registry for Elsa, allowing the registration of shared processes like brod clients as well as processes started under brod supervision.

Saves the process identifier-to-name key/value pairs to ETS.

Link to this section Summary

Functions

Returns a specification to start this module under a supervisor.

Callback implementation for GenServer.init/1.

Register the pid of a process to the registry under a given name.

Select all records within the registry and return them as a list.

Wraps the Kernel module send/2 function with a safe call to ensure the receiving process is defined.

Start the Elsa registery process and link it to the current process. Creates the process registry table in ETS and traps exits during the init process.

De-register the process name from its associated pid within the registry.

Lookup a pid from within the registry by name.

Link to this section Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

Callback implementation for GenServer.init/1.

@spec register_name(
  {atom(), term()},
  pid()
) :: :yes

Register the pid of a process to the registry under a given name.

@spec select_all(atom() | :ets.tid()) :: [tuple()]

Select all records within the registry and return them as a list.

@spec send(
  {atom(), term()},
  term()
) :: term()

Wraps the Kernel module send/2 function with a safe call to ensure the receiving process is defined.

@spec start_link(keyword()) :: GenServer.on_start()

Start the Elsa registery process and link it to the current process. Creates the process registry table in ETS and traps exits during the init process.

@spec unregister_name({atom(), term()}) :: :ok

De-register the process name from its associated pid within the registry.

@spec whereis_name({atom(), term()}) :: pid() | :undefined

Lookup a pid from within the registry by name.