Horde v0.5.0-rc.4 Horde.Cluster View Source

Public functions to join and leave hordes.

Calling Horde.Cluster.set_members/2 will join the given members in a cluster. Cluster membership is propagated via a CRDT, so setting it once on a single node is sufficient.

{: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.set_members(:supervisor_1, [:supervisor_1, :supervisor_2, :supervisor_3])

Link to this section Summary

Link to this section Types

Link to this type member() View Source
member() :: {name :: atom(), node :: atom()} | (name :: atom())

Link to this section Functions

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

Get the members (nodes) of the horde

Link to this function set_members(horde, members, timeout \\ 5000) View Source