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

This protocol defines the behavior of a synchronization strategy.

Summary

Functions

Handles the periodic synchronization of the process registry.

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

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/5.

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.

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)

View Source
@spec propagate(t(), ProcessHub.hub_id(), [term()], node(), :add | :rem) :: :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.