View Source ProcessHub.Strategy.PartitionTolerance.Base protocol (ProcessHub v0.8.0)

The partition tolerance strategy protocol defines the behavior for handling node up and down events in the ProcessHub cluster.

Summary

Types

t()

All the types that implement this protocol.

Functions

Triggered when coordinator is initialized.

Determines if a quorum failure should be triggered when a node leaves the cluster.

Determines if a quorum recovery should be triggered when a node joins the cluster.

Checks the strategy's settings before the hub starts.

Types

@type t() :: term()

All the types that implement this protocol.

Functions

@spec init(
  struct(),
  ProcessHub.Hub.t()
) :: struct()

Triggered when coordinator is initialized.

Could be used to perform initialization.

Link to this function

toggle_lock?(strategy, hub, down_node, kind)

View Source
@spec toggle_lock?(t(), ProcessHub.Hub.t(), node(), :down | :leave) :: boolean()

Determines if a quorum failure should be triggered when a node leaves the cluster.

kind is :leave when the node drained or stopped its hub while connected, so it was reachable when it went and cannot be on the other side of a split, and :down when it disappeared without either.

Link to this function

toggle_unlock?(strategy, hub, down_node)

View Source
@spec toggle_unlock?(t(), ProcessHub.Hub.t(), node()) :: boolean()

Determines if a quorum recovery should be triggered when a node joins the cluster.

@spec validate(struct()) :: :ok | {:error, {:invalid_config, term()}}

Checks the strategy's settings before the hub starts.