libcluster v3.1.0 Cluster.Strategy behaviour
This module defines the behaviour for implementing clustering strategies.
Link to this section Summary
Functions
Given a list of node names, attempts to connect to all of them.
Returns :ok
if all nodes connected, or {:error, [{node, reason}, ..]}
if we failed to connect to some nodes.
Given a list of node names, attempts to disconnect from all of them.
Returns :ok
if all nodes disconnected, or {:error, [{node, reason}, ..]}
if we failed to disconnect from some nodes.
Link to this section Types
bad_nodes()
mfa_tuple()
strategy_args()
strategy_args() :: [Cluster.Strategy.State.t()]
strategy_args() :: [Cluster.Strategy.State.t()]
topology()
topology() :: atom()
topology() :: atom()
Link to this section Functions
connect_nodes(topology, connect, list_nodes, nodes)
Given a list of node names, attempts to connect to all of them.
Returns :ok
if all nodes connected, or {:error, [{node, reason}, ..]}
if we failed to connect to some nodes.
All failures are logged.
difference(a, b)
disconnect_nodes(topology, disconnect, list_nodes, nodes)
Given a list of node names, attempts to disconnect from all of them.
Returns :ok
if all nodes disconnected, or {:error, [{node, reason}, ..]}
if we failed to disconnect from some nodes.
All failures are logged.
intersection(a, b)
Link to this section Callbacks
child_spec(strategy_args)
child_spec(strategy_args()) :: Supervisor.child_spec()
child_spec(strategy_args()) :: Supervisor.child_spec()
start_link(strategy_args)
start_link(strategy_args()) ::
{:ok, pid()} | :ignore | {:error, reason :: term()}
start_link(strategy_args()) :: {:ok, pid()} | :ignore | {:error, reason :: term()}