View Source ProcessHub.Service.Dispatcher (ProcessHub v0.5.0-beta)
The dispatcher service provides API functions for dispatching events.
Summary
Functions
Sends StartChildrenRequest structs to their target coordinator processes.
Sends StopChildrenRequest structs to their target coordinator processes.
Dispatches an event to the event queue.
Propagates a request to cluster members via the synchronization strategy.
Sends a message to all the respondents who are waiting for a response.
Functions
@spec children_start(ProcessHub.Hub.t(), [ ProcessHub.Request.Handler.StartChildrenRequest.t() ]) :: :ok
Sends StartChildrenRequest structs to their target coordinator processes.
Each StartChildrenRequest contains all routing information needed by the remote node to process the request and send responses back.
@spec children_stop(ProcessHub.Hub.t(), [ ProcessHub.Request.Handler.StopChildrenRequest.t() ]) :: :ok
Sends StopChildrenRequest structs to their target coordinator processes.
Each StopChildrenRequest contains all routing information needed by the remote node to process the request and send responses back.
@spec dispatch_event(atom(), atom(), term(), %{ optional(:discard_event) => boolean(), optional(:members) => :global | :local | :external | [node()] }) :: {:ok, :event_discarded | :event_dispatched | :event_queued}
Dispatches an event to the event queue.
@spec propagate_event(ProcessHub.Hub.t(), struct(), keyword()) :: :ok
Propagates a request to cluster members via the synchronization strategy.
Options
:members- Target members (:global,:local,:external, or[node()]). Defaults to:global.
@spec reply_respondents([pid()], atom(), ProcessHub.child_id(), term(), node()) :: :ok
Sends a message to all the respondents who are waiting for a response.