View Source Cloister.Monitor (cloister v0.10.1)

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

Type of the node as it has been started

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

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

Group of nodes sharing the same hashring

@type node_type() :: :longnames | :shortnames | :nonode

Type of the node as it has been started

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

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

@type 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.

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

Rehashes the ring and returns the current state

@spec siblings() :: [node()]

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() :: t()

Returns an internal state of the Node