View Source ProcessHub.Service.State (ProcessHub v0.2.0-alpha)

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

Summary

Functions

Returns a boolean indicating whether the hub is locked.

Returns a boolean indicating whether the hub cluster is partitioned.

Locks the event handler and dispatches the priority state updated hook.

Locks the event handler and kills the local distributed supervisor.

Unlocks the local event handler and restarts the local distributed supervisor.

Unlocks the event handler and dispatches the priority state updated hook.

Functions

@spec is_locked?(ProcessHub.hub_id()) :: boolean()

Returns a boolean indicating whether the hub is locked.

@spec is_partitioned?(atom()) :: boolean()

Returns a boolean indicating whether the hub cluster is partitioned.

Link to this function

lock_event_handler(hub_id, reset \\ 60000)

View Source
@spec lock_event_handler(ProcessHub.hub_id(), pos_integer() | nil) :: :ok

Locks the event handler and dispatches the priority state updated hook.

Link to this function

toggle_quorum_failure(hub_id)

View Source
@spec toggle_quorum_failure(ProcessHub.hub_id()) ::
  :ok | {:error, :already_partitioned}

Locks the event handler and kills the local distributed supervisor.

Link to this function

toggle_quorum_success(hub_id)

View Source
@spec toggle_quorum_success(ProcessHub.hub_id()) :: :ok | {:error, :not_partitioned}

Unlocks the local event handler and restarts the local distributed supervisor.

Link to this function

unlock_event_handler(hub_id)

View Source
@spec unlock_event_handler(ProcessHub.hub_id()) :: :ok

Unlocks the event handler and dispatches the priority state updated hook.