elsa v0.12.3 Elsa.Registry

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

Link to this function

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

Callback implementation for GenServer.init/1.

Link to this function

register_name(arg, pid)

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

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

Link to this function

select_all(registry)

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

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

Link to this function

send(arg, msg)

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

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

Link to this function

start_link(args)

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.

Link to this function

unregister_name(arg)

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

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

Link to this function

whereis_name(arg)

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

Lookup a pid from within the registry by name.