Beethoven (Beethoven v0.3.5)

A Decentralized failover and peer-to-peer node finder for Elixir. Allows Elixir nodes to find each other automatically. Once connected, they can coordinate to delegate roles and tasks between the nodes in the cluster. Written using only the Elixir and Erlang standard library.

This module acts as the unified client for interacting with beethoven as an external client. Avoid using the other modules for external PID calls to beethoven services.

Summary

Types

List of node names.

Status of a Beethoven cluster node.

List of nodeStatus() objects.

Role data structure.

List of role().

Functions

Returns all active cluster nodes by their Node name URI. Returns an empty list if this node is in :standalone.

Returns all cluster nodes and their state.

Returns state of this node within the Beethoven cluster. Return will only be :clustered or :standalone.

Returns all roles hosted in Beethoven.

Gets the current ready state for Beethoven.

Similar to ready?() but will block until the service is ready. Defaults to 5_000 milliseconds.

Types

nodeList()

@type nodeList() :: [node()]

List of node names.

nodeStatusMap()

@type nodeStatusMap() :: %{
  node: node(),
  status: Beethoven.CoreServer.nodeStatus(),
  last_change: DateTime.t()
}

Status of a Beethoven cluster node.

nodeStatusMapList()

@type nodeStatusMapList() :: [nodeStatusMap()]

List of nodeStatus() objects.

role()

@type role() :: %{
  role: atom(),
  count: integer(),
  assigned: integer(),
  nodes: nodeList()
}

Role data structure.

roleList()

@type roleList() :: [role()]

List of role().

Functions

get_active_nodes()

@spec get_active_nodes() :: nodeList()

Returns all active cluster nodes by their Node name URI. Returns an empty list if this node is in :standalone.

get_cluster_nodes()

@spec get_cluster_nodes() :: nodeStatusMapList()

Returns all cluster nodes and their state.

get_node_status()

@spec get_node_status() :: Beethoven.CoreServer.serverStatus()

Returns state of this node within the Beethoven cluster. Return will only be :clustered or :standalone.

Wrapper for Beethoven.CoreServer.get_mode/0.

get_roles()

@spec get_roles() :: roleList()

Returns all roles hosted in Beethoven.

ready?()

@spec ready?() :: boolean()

Gets the current ready state for Beethoven.

Wrapper for Beethoven.Ready.ready?/0.

until_ready(timeout \\ 5000)

@spec until_ready(integer()) :: :ok | :timeout

Similar to ready?() but will block until the service is ready. Defaults to 5_000 milliseconds.

Wrapper for Beethoven.Ready.until_ready/1.