View Source ProcessHub.Strategy.Synchronization.Base protocol (ProcessHub v0.5.0-beta)
This protocol defines the behavior of a synchronization strategy.
Summary
Functions
Broadcasts local registry data to target nodes when they join the cluster. Called after nodes are added to the cluster state.
Handles received node join data and stores it in the local registry. Called when another node broadcasts its registry data to us.
Handles the periodic synchronization of the process registry.
Triggered when coordinator is initialized.
Initializes the periodic synchronization of the process registry.
Propagates requests to other nodes in the cluster.
Types
@type t() :: term()
All the types that implement this protocol.
Functions
@spec broadcast_local_data( t(), ProcessHub.Hub.t(), [{ProcessHub.child_spec(), pid(), ProcessHub.child_metadata()}], [node()] ) :: :ok
Broadcasts local registry data to target nodes when they join the cluster. Called after nodes are added to the cluster state.
@spec handle_node_join_data(t(), ProcessHub.Hub.t(), term(), node()) :: :ok
Handles received node join data and stores it in the local registry. Called when another node broadcasts its registry data to us.
@spec handle_synchronization(t(), ProcessHub.Hub.t(), term(), node()) :: :ok
Handles the periodic synchronization of the process registry.
@spec init( struct(), ProcessHub.Hub.t() ) :: struct()
Triggered when coordinator is initialized.
Could be used to perform initialization.
@spec init_sync(t(), ProcessHub.Hub.t(), [node()]) :: :ok
Initializes the periodic synchronization of the process registry.
@spec propagate( t(), ProcessHub.Hub.t(), [ProcessHub.Request.CrossNodeRequest.t()], keyword() ) :: :ok
Propagates requests to other nodes in the cluster.