Cloister.Monitor (cloister v0.7.1) View Source

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

This process is started and supervised by Cloister.Manager.

Link to this section Summary

Types

Group of nodes sharing the same hashring

Statuses the node running the code might be in regard to cloister

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

Link to this section Types

Specs

group() :: {atom(), [node()]}

Group of nodes sharing the same hashring

Specs

status() :: :down | :starting | :joined | :up | :stopping | :rehashing | :panic

Statuses the node running the code might be in regard to cloister

Specs

t() :: %Cloister.Monitor{
  otp_app: atom(),
  groups: [group()],
  listener: module(),
  started_at: DateTime.t(),
  status: status(),
  alive?: boolean(),
  clustered?: boolean(),
  sentry?: boolean(),
  ring: atom()
}

The monitor internal state

Link to this section Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

Specs

nodes!(timeout :: non_neg_integer()) :: t()

Rehashes the ring and returns the current state

Specs

siblings() :: [node()]

Returns the nodes in the cluster that are connected to this one in the same group

Specs

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.

Specs

state() :: t()

Returns an internal state of the Node