View Source ProcessHub.Strategy.PartitionTolerance.Base protocol (ProcessHub v0.3.2-alpha)

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 the lock should be toggled when a node leaves the cluster.

Determines if the lock should be released when a node joins the cluster.

Types

@type t() :: term()

All the types that implement this protocol.

Functions

@spec init(
  struct(),
  ProcessHub.hub_id()
) :: any()

Triggered when coordinator is initialized.

Could be used to perform initialization.

Link to this function

toggle_lock?(strategy, hub_id, down_node)

View Source
@spec toggle_lock?(t(), ProcessHub.hub_id(), node()) :: boolean()

Determines if the lock should be toggled when a node leaves the cluster.

Link to this function

toggle_unlock?(strategy, hub_id, down_node)

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

Determines if the lock should be released when a node joins the cluster.