View Source ProcessHub.Strategy.Synchronization.Base protocol (ProcessHub v0.4.0-beta)
This protocol defines the behavior of a synchronization strategy.
Summary
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
@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.Handler.ChildrenAdd.PostStartData.t() | ProcessHub.Handler.ChildrenRem.StopHandle.t() ], 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.