View Source ProcessHub.Strategy.Synchronization.Base protocol (ProcessHub v0.2.0-alpha)
This protocol defines the behavior of a synchronization strategy.
Summary
Functions
This function handles the propagation messages sent by ProcessHub.Strategy.Synchronization.Base.propagate/6
.
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
@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.
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.
@spec init_sync(t(), ProcessHub.hub_id(), [node()]) :: :ok
Initializes the periodic synchronization of the process registry.
@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.