View Source ProcessHub.Strategy.Redundancy.Base protocol (ProcessHub v0.1.0-alpha)
The redundancy protocol relies on the HashRing
library to distribute processes across
the cluster and determine which node should be responsible for a given process by its child_id
key.
It is possible to start the same process on multiple nodes in the cluster.
Summary
Functions
Determines the nodes that are responsible for the given child_id
(process).
This function is called when ProcessHub.DistributedSupervisor
has started a new
child process, and the strategy can perform any post-start actions.
This function is called when ProcessHub.DistributedSupervisor
has started a
replica of a child process, and the strategy can perform any post-update actions.
Returns the replication factor for the given strategy struct. This is the number of replicas that the process will be started with.
Types
@type t() :: term()
Functions
Determines the nodes that are responsible for the given child_id
(process).
This function is called when ProcessHub.DistributedSupervisor
has started a new
child process, and the strategy can perform any post-start actions.
This function is called when ProcessHub.DistributedSupervisor
has started a
replica of a child process, and the strategy can perform any post-update actions.
@spec replication_factor(strategy_struct :: struct()) :: pos_integer()
Returns the replication factor for the given strategy struct. This is the number of replicas that the process will be started with.