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.
Returns a boolean indicating whether the hub cluster is partitioned.
@spec lock_event_handler(ProcessHub.hub_id(), pos_integer() | nil) :: :ok
Locks the event handler and dispatches the priority state updated hook.
@spec toggle_quorum_failure(ProcessHub.hub_id()) :: :ok | {:error, :already_partitioned}
Locks the event handler and kills the local distributed supervisor.
@spec toggle_quorum_success(ProcessHub.hub_id()) :: :ok | {:error, :not_partitioned}
Unlocks the local event handler and restarts the local distributed supervisor.
@spec unlock_event_handler(ProcessHub.hub_id()) :: :ok
Unlocks the event handler and dispatches the priority state updated hook.