View Source Cloister.Monitor (cloister v0.18.0)
The actual process that performs the monitoring of the cluster and invokes callbacks.
This process is started and supervised by Cloister.Manager
.
Summary
Functions
Returns a specification to start this module under a supervisor.
Rehashes the ring and returns the current state
Returns the nodes in the cluster that are connected to this one in the same group
Used to start Cloister.Monitor
.
Returns an internal state of the Node
Types
@type monitor() :: %{fsm: Finitomata.fsm_name(), ring: atom(), groups: [node()]}
Monitor state
@type node_type() :: :longnames | :shortnames | :nonode
Type of the node as it has been started
@type t() :: %Cloister.Monitor{ otp_app: atom(), node: node(), consensus: pos_integer(), listener: module(), monitor: module(), started_at: DateTime.t(), alive?: boolean(), clustered?: boolean(), sentry?: boolean(), ring: atom() }
The monitor internal state
Functions
Returns a specification to start this module under a supervisor.
See Supervisor
.
Rehashes the ring and returns the current state
Returns the nodes in the cluster that are connected to this one in the same group
@spec start_link(opts :: keyword()) :: GenServer.on_start()
Used to start Cloister.Monitor
.
Internally called by Cloister.Manager.start_link/1
. In most cases
you don’t need to start Monitor
process explicitly.
@spec state(module(), timeout(), non_neg_integer()) :: monitor()
Returns an internal state of the Node