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

Link to this function

children_start(hub, node_start_requests)

View Source

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.

Link to this function

children_stop(hub, node_stop_requests)

View Source

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.

Link to this function

dispatch_event(event_queue, event_id, event_data, opts \\ %{})

View Source
@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.

Link to this function

propagate_event(hub, request, opts \\ [])

View Source
@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.
Link to this function

reply_respondents(respondents, key, child_id, result, node)

View Source
@spec reply_respondents([pid()], atom(), ProcessHub.child_id(), term(), node()) :: :ok

Sends a message to all the respondents who are waiting for a response.