horde v0.1.4 Horde.Registry

A distributed process registry.

Horde.Registry implements a distributed Registry backed by an add-wins last-write-wins δ-CRDT (provided by DeltaCrdt.AWLWWMap). This CRDT is used for both tracking membership of the cluster and implementing the registry functionality itself. Local changes to the registry will automatically be synced to other nodes in the cluster.

Because of the semantics of an AWLWWMap, the guarantees provided by Horde.Registry are more relaxed than those provided by the standard library Registry. Conflicts will be automatically silently resolved by the underlying AWLWWMap.

Cluster membership is managed with Horde.Cluster. Joining and leaving a cluster can be done with Horde.Cluster.join_hordes/2 and Horde.Cluster.leave_hordes/1.

Horde.Registry supports the common “via tuple”, described in the documentation for GenServer.

Link to this section Summary

Functions

Child spec to enable easy inclusion into a supervisor

Get the process regsitry of the horde

register a process under the given name

unregister the process under the given name

Link to this section Functions

Link to this function child_spec(options \\ [])
child_spec(options :: list()) :: Supervisor.child_spec()

Child spec to enable easy inclusion into a supervisor.

Example:

supervise([
  Horde.Registry
])

Example:

supervise([
  {Horde.Registry, [name: MyApp.GlobalRegistry]}
])
Link to this function handle_call(arg1, from, state)
Link to this function handle_cast(arg1, state)
Link to this function handle_info(arg1, state)
Link to this function lookup(horde, name)
Link to this function processes(horde)

Get the process regsitry of the horde

Link to this function register(horde, name, pid \\ self())
register(horde :: GenServer.server(), name :: atom(), pid :: pid()) ::
  {:ok, pid()}

register a process under the given name

Link to this function start_link(options)
start_link(options :: list()) :: GenServer.on_start()
Link to this function unregister(horde, name)
unregister(horde :: GenServer.server(), name :: GenServer.name()) :: :ok

unregister the process under the given name

Link to this function whereis(search)