Anoma.Node.Examples.ERegistry (Anoma v0.29.0)
Summary
Functions
I create an address for a given node id and module.
I create an address for a given node id, module, and label.
I register a process in the registry and then lookup its pid.
Given a node id and an engine, I generate a name that can be used to register processes.
I generate a name from a module, node id and label.
I register a few engines for a specific node, and then ask the registry for the list.
Given a node id and an engine, I check if this process is registered and alive.
I start a new registry, or return the address of the one that is already running.
Types
@type t() :: %Anoma.Node.Examples.ERegistry{pid: pid() | nil}
I am the state of a registry created in the examples.
Fields
:pid
- the pid of the supervision tree.
Functions
create_address()
@spec create_address() :: Anoma.Node.Registry.Address.t()
I create an address for a given node id and module.
I assert that the address is created correctly.
create_address_with_label()
@spec create_address_with_label() :: Anoma.Node.Registry.Address.t()
I create an address for a given node id, module, and label.
find_pid_of_process(node_id \\ "")
@spec find_pid_of_process(String.t()) :: :ok
I register a process in the registry and then lookup its pid.
generate_name()
@spec generate_name() :: {:via, atom(), {atom(), Anoma.Node.Registry.Address.t()}}
Given a node id and an engine, I generate a name that can be used to register processes.
generate_name_with_label()
@spec generate_name_with_label() :: {:via, atom(), {atom(), Anoma.Node.Registry.Address.t()}}
I generate a name from a module, node id and label.
list_engines_for_node(node_id \\ "")
@spec list_engines_for_node(String.t()) :: :ok
I register a few engines for a specific node, and then ask the registry for the list.
process_registered?(node_id, engine)
Given a node id and an engine, I check if this process is registered and alive.
start_registry()
@spec start_registry() :: t() | :error
I start a new registry, or return the address of the one that is already running.