Horde v0.3.0 Horde.Cluster View Source

Public functions to join and leave hordes.

Calling Horde.Cluster.join_hordes/2 will join two nodes in the cluster. Cluster membership is associative so joining a node to another node is the same as joining a node to every node in the second node’s cluster.

{:ok, sup1} = Horde.Supervisor.start_link([], name: :supervisor_1, strategy: :one_for_one)
{:ok, sup2} = Horde.Supervisor.start_link([], name: :supervisor_2, strategy: :one_for_one)
{:ok, sup3} = Horde.Supervisor.start_link([], name: :supervisor_3, strategy: :one_for_one)

:ok = Horde.Cluster.join_hordes(sup1, sup2)
:ok = Horde.Cluster.join_hordes(sup2, sup3)

Link to this section Summary

Functions

Join two hordes into one big horde. Calling this once will inform every node in each horde of every node in the other horde. Leave the hordes by calling Horde.Supervisor.stop/1 or Horde.Registry.stop/1

Get the members (nodes) of the horde

Link to this section Functions

Link to this function join_hordes(horde, other_horde, timeout \\ 5000) View Source

Join two hordes into one big horde. Calling this once will inform every node in each horde of every node in the other horde. Leave the hordes by calling Horde.Supervisor.stop/1 or Horde.Registry.stop/1

Link to this function members(horde) View Source
members(horde :: GenServer.server()) :: map()

Get the members (nodes) of the horde