View Source ProcessHub.Strategy.Migration.Base protocol (ProcessHub v0.2.0-alpha)

The migration strategy protocol provides API functions for migrating child processes.

Summary

Types

t()

All the types that implement this protocol.

Functions

Migrates processes from the local to the remote node.

Triggered when coordinator is initialized.

Types

@type t() :: term()

All the types that implement this protocol.

Functions

Link to this function

handle_migration(struct, hub_id, child_specs, added_node, sync_strategy)

View Source

Migrates processes from the local to the remote node.

Process migration happens when a new node joins the ProcessHub cluster, and some of the local processes are moved to the newly connected node. This also requires the processes to be terminated on the local node.

The redundancy strategy will deal with scenarios where processes are not terminated locally and are duplicated on the new node.

@spec init(
  struct(),
  ProcessHub.hub_id()
) :: any()

Triggered when coordinator is initialized.

Could be used to perform initialization.