Elsa.Registry (Elsa v1.0.0-rc.3) View Source

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.

Specs

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

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

Specs

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

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

Specs

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

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

Specs

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.

Specs

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

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

Specs

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

Lookup a pid from within the registry by name.