View Source NodeRegistry (node_registry v0.1.1)

A simple registry for nodes. It uses the Erlang :global module. https://www.erlang.org/doc/man/global.html One must start the registry on each node: Add {NodeRegistry, :my_service} to the supervisor's children list.

Link to this section Summary

Link to this section Types

@type name() :: atom() | String.t()
@type t() :: %NodeRegistry{name: name(), node: node(), pid: pid()}

Link to this section Functions

@spec all() :: [t()]

Returns a specification to start this module under a supervisor.

See Supervisor.

@spec info(node() | atom()) :: t()
@spec node_with_name(name()) :: node() | nil
Link to this function

nodes_with_prefix(prefix)

View Source
@spec nodes_with_prefix(name()) :: [node()]
Link to this function

random_node_with_prefix(prefix)

View Source
@spec random_node_with_prefix(name()) :: node()
@spec start_link(name()) :: GenServer.on_start()