View Source gc_dist behaviour (gen_cluster v0.3.0)
Behaviour to implement to build a new method for connecting nodes into a cluster.
Summary
Types
The state of the callback.
Callbacks
Connect the current node to the argument peer.
Disconnect the peer from the current node.
Called only when a gen_cluster
first starts or restarts.
Return the current members connected in the cluster.
Types
-type cb_state() :: term().
The state of the callback.
Callbacks
-callback connect(gen_cluster:peer(), cb_state()) -> boolean() | ignored.
Connect the current node to the argument peer.
-callback disconnect(gen_cluster:peer(), cb_state()) -> boolean() | ignored.
Disconnect the peer from the current node.
Called only when a gen_cluster
first starts or restarts.
-callback members(cb_state()) -> gen_cluster:peers().
Return the current members connected in the cluster.