View Source ProcessHub.Service.Synchronizer (ProcessHub v0.5.0-beta)

The synchronizer service provides API functions for synchronizing process registry data between nodes.

Summary

Functions

Appends remote data to the local process registry.

Broadcasts local registry data to the specified target nodes.

Detaches remote data from the local process registry.

Returns local node's process registry data used for synchronization.

Helper function to trigger interval synchronization.

Functions

Link to this function

append_data(hub, remote_data)

View Source
@spec append_data(ProcessHub.Hub.t(), %{
  required(node()) => [
    {ProcessHub.child_spec(), pid(), ProcessHub.child_metadata()}
  ]
}) :: :ok

Appends remote data to the local process registry.

Link to this function

broadcast_local_registry(state, target_nodes)

View Source
@spec broadcast_local_registry(ProcessHub.Hub.t(), [node()]) :: :ok

Broadcasts local registry data to the specified target nodes.

Called when new nodes join the cluster to share local process information.

Link to this function

detach_data(hub, remote_children)

View Source
@spec detach_data(ProcessHub.Hub.t(), %{
  required(node()) => [{ProcessHub.child_spec(), pid()}]
}) :: :ok

Detaches remote data from the local process registry.

Link to this function

exec_interval_sync(hub_id, strategy, sync_data, remote_node)

View Source
@spec local_sync_data(ProcessHub.Hub.t()) :: [
  {ProcessHub.child_spec(), pid(), ProcessHub.child_metadata()}
]

Returns local node's process registry data used for synchronization.

Helper function to trigger interval synchronization.

The system will use the configured synchronization strategy.