View Source Cloister.Monitor (cloister v0.18.1)

The actual process that performs the monitoring of the cluster and invokes callbacks.

This process is started and supervised by Cloister.Manager.

Summary

Types

Monitor state

Type of the node as it has been started

t()

The monitor internal state

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

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.

This function is deprecated. Use `siblings/0` instead.

Rehashes the ring and returns the current state

Link to this function

siblings(name \\ __MODULE__)

View Source
@spec siblings(module()) :: [node()] | {:error, :no_such_ring}

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.

Link to this function

state(name \\ __MODULE__, timeout \\ 60000, retries \\ 5)

View Source
@spec state(module(), timeout(), non_neg_integer()) :: monitor()

Returns an internal state of the Node