View Source API Reference ProcessHub v0.2.0-alpha

Modules

This is the main public API module for the ProcessHub library and it is recommended to use only the functions defined in this module to interact with the ProcessHub library.

Custom events defined as macros.

Defines the list of hooks that can be used to extend the functionality of ProcessHub.

Priority levels for the local event queue.

The ProcessHub coordinator module is responsible for coordinating most of the ProcessHub events and work.

The ProcessHub distributed supervisor module is responsible for starting and stopping the child processes distributed across the cluster.

Handler for starting child processes.

Handler for synchronizing added child processes.

Handler for stopping child processes.

Handler for synchronizing stopped child processes.

Handler for the node down event.

Handler for the node up event.

Handler for periodic synchronization.

Handler for initializing synchronization.

Handler for emitting process registry data.

The main ProcessHub initializer supervisor module.

ProcessHub instances with the same hub_id will automatically form a cluster. The cluster service provides API functions for managing the cluster.

The dispatcher service provides API functions for dispatching events.

The distributor service provides API functions for distributing child processes.

The hook manager service provides API functions for managing hook dispatching, registration, and lookup.

The local storage service provides API functions for managing local storage. This is mainly used for storing data that is not required to be persisted.

The messenger service provides API functions for receiving messages from other processes.

The process registry service provides API functions for managing the process registry.

The Ring service provides API functions for managing the hash ring.

The state service provides API functions for managing the state of the hub and locking/unlocking the local event handler.

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

The distribution strategy protocol defines behaviour to identify the nodes which are responsible for a child process.

Provides implementation for distribution behaviour using consistent hashing.

Provides implementation for distribution behaviour using consistent hashing.

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

The cold swap migration strategy implements the ProcessHub.Strategy.Migration.Base protocol. It provides a migration strategy where the local process is terminated before starting it on the remote node.

The hot swap migration strategy implements the ProcessHub.Strategy.Migration.Base protocol. It provides a migration strategy where the local process is terminated after the new one is started on the remote node.

The partition tolerance strategy protocol defines the behavior for handling node up and down events in the ProcessHub cluster.

The divergence strategy for partition tolerance is used when the ProcessHub cluster is not concerned with partition failures.

The dynamic quorum strategy provides a dynamic way to handle network partitions in the ProcessHub cluster.

The static quorum strategy for partition tolerance is used when the ProcessHub cluster is concerned with partition failures, and the cluster size is known.

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.

The replication strategy allows for multiple instances of a process to be started across the cluster. The number of instances is determined by the replication_factor option.

The Singularity strategy starts a single instance of a process and creates no replicas on other nodes. This is the default strategy.

This protocol defines the behavior of a synchronization strategy.

The Gossip synchronization strategy provides a method for spreading information to other nodes within the ProcessHub cluster. It utilizes a gossip protocol to synchronize the process registry across the cluster.

This PubSub synchronization strategy uses the :blockade library to dispatch and handle synchronization events. Each ProcessHub instance has its own event queue that is used to dispatch and handle synchronization events.

Utility functions.

Utility functions for generating names processes/ETS tables registered under the hub_id.