View Source LibclusterPostgres.Strategy (libcluster_postgres v0.2.0)

A libcluster strategy that uses Postgres LISTEN/NOTIFY to determine the cluster topology.

This strategy operates by having all nodes in the cluster listen for and send notifications to a shared Postgres channel.

When a node comes online, it begins to broadcast its name in a "heartbeat" message to the channel. All other nodes that receive this message attempt to connect to it.

This strategy does not check connectivity between nodes and does not disconnect them

Options

  • heartbeat_interval - The interval at which to send heartbeat messages in milliseconds (optional; default: 5_000)
  • channel_name - The name of the channel to which nodes will listen and notify (optional; defaults to the result of Node.get_cookie/0)

Summary

Functions

Returns a specification to start this module under a supervisor.

Callback implementation for GenServer.init/1.

Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function

handle_continue(atom, state)

View Source

Callback implementation for GenServer.handle_continue/2.

@spec init([%{:config => any(), :meta => any(), optional(any()) => any()}, ...]) ::
  {:ok, %{:config => list(), :meta => map(), optional(any()) => any()},
   {:continue, :connect}}

Callback implementation for GenServer.init/1.