View Source Cloister (cloister v0.15.0)
Cloister is a consensus helper for clusters.
It is designed to be a configurable drop-in for transparent cluster support.
supported-options
Supported options
:otp_app(atom/0) - OTP application this cloister runs for. The default value is:cloister.:sentry- Required. The way the cloister knows how to build cluster; might be a service name or a node list. E. g.:"cloister.local"or~w[c1@127.0.0.1 c2@127.0.0.1]a. Default[node()].:consensus(non_neg_integer/0) - Required. Number of nodes to consider consensus. The default value is1.:listener(atom/0) - Listener to be called when the ring is changed. The default value isCloister.Listener.Default.:additional_modules- Additional modules to include intoCloister.Manager’s supervision tree.:ring(atom/0) - The name of theHashRingto be used. If set, the HashRing is assumed to be managed externally.:manager(non-emptykeyword/0) - Set of options to configureCloister.Managerwhen started in a supervision tree.:monitor_opts(non-emptykeyword/0) - FineCloister.Monitor’s tuning.:name(atom/0) - Required. Name of theMonitorprocess.
:loopback?(boolean/0) - Use loopback interface in FQ node name? The default value isfalse.:magic?(boolean/0) - When false, allows to avoid node reinitialization The default value istrue.
Link to this section Summary
Functions
Returns a specification to start this module under a supervisor.
Returns true if the hashring points to this node for the term given, false otherwise
Applies the function given as m, f, a on all the nodes given as a first parameter.
Returns the ring from current node cloister monitor state
See Cloister.Monitor.siblings!/0.
Returns who would be chosen by a hash ring for the term in the group given
Link to this section Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
Returns true if the hashring points to this node for the term given, false otherwise
Applies the function given as m, f, a on all the nodes given as a first parameter.
If no nodes are given, it defaults to Cloister.siblings/0.
@spec ring() :: atom()
Returns the ring from current node cloister monitor state
See Cloister.Monitor.siblings!/0.
@spec whois(group :: atom(), term :: any()) :: node() | {:error, {:invalid_ring, :no_nodes}} | {:error, {:not_our_ring, atom()}}
Returns who would be chosen by a hash ring for the term in the group given