Anoma.Node.Registry (Anoma v0.29.0)
I am the Node Registry module.
I provide functionality for creating addresses, registering engines to specific addresses, and querying information regarding the registered addresses and engines.
Public API
Summary
Functions
I create an address with specified node id, engine name and label.
I return the contents of the registry.
Given a node_id, I return a list of all the engine names I know for this node.
Given an engine type, I return the name of the local engine of that type.
I register the calling process under the name of the engine at the given node id.
I generate the :via stanza for a process with the given node_id and engine name.
Given a node id and engine, I check if there is a process registered with that address and return the pid.
Functions
address(node_id, engine, label \\ nil)
@spec address(String.t(), atom(), atom()) :: Anoma.Node.Registry.Address.t()
I create an address with specified node id, engine name and label.
dump_register()
@spec dump_register() :: [{Anoma.Node.Registry.Address.t(), pid(), any()}]
I return the contents of the registry.
engines_for(node_id)
Given a node_id, I return a list of all the engine names I know for this node.
I filter out all the non-engine names based on an allow list.
local_node_id()
Given an engine type, I return the name of the local engine of that type.
If there are multiple engines of that type present, I raise an error.
register(node_id, engine, label \\ nil)
I register the calling process under the name of the engine at the given node id.
via(node_id, engine, label \\ nil)
@spec via(String.t(), atom(), atom()) :: {:via, Registry, {atom(), Anoma.Node.Registry.Address.t()}}
I generate the :via stanza for a process with the given node_id and engine name.
whereis(node_id, engine, label \\ nil)
Given a node id and engine, I check if there is a process registered with that address and return the pid.