View Source ProcessHub.Strategy.Synchronization.Base protocol (ProcessHub v0.2.0-alpha)

This protocol defines the behavior of a synchronization strategy.

Summary

Types

t()

All the types that implement this protocol.

Functions

Handles the periodic synchronization of the process registry.

Triggered when coordinator is initialized.

Initializes the periodic synchronization of the process registry.

This function is called when a process has been started on the local node, and the information about the process is about to be propagated to other nodes.

Types

@type t() :: term()

All the types that implement this protocol.

Functions

Link to this function

handle_propagation(strategy, hub_id, propagation_data, type)

View Source
@spec handle_propagation(t(), ProcessHub.hub_id(), term(), :add | :rem) :: :ok

This function handles the propagation messages sent by ProcessHub.Strategy.Synchronization.Base.propagate/6.

It saves the process data that was propagated to the local process registry.

Link to this function

handle_synchronization(strategy, hub_id, remote_data, remote_node)

View Source
@spec handle_synchronization(t(), ProcessHub.hub_id(), term(), node()) :: :ok

Handles the periodic synchronization of the process registry.

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

Triggered when coordinator is initialized.

Could be used to perform initialization.

Link to this function

init_sync(strategy, hub_id, cluster_nodes)

View Source
@spec init_sync(t(), ProcessHub.hub_id(), [node()]) :: :ok

Initializes the periodic synchronization of the process registry.

Link to this function

propagate(strategy, hub_id, children, node, type, opts)

View Source
@spec propagate(t(), ProcessHub.hub_id(), [term()], node(), :add | :rem, keyword()) ::
  :ok

This function is called when a process has been started on the local node, and the information about the process is about to be propagated to other nodes.