View Source ProcessHub.Service.Dispatcher (ProcessHub v0.3.2-alpha)

The dispatcher service provides API functions for dispatching events.

Summary

Functions

Sends the coordinator process a message to start the child processes passed in.

Sends the coordinator process a message to start the child processes passed in.

Sends the coordinator process a message to stop the child processes passed in.

Propagates the event to the event queue.

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

Functions

Link to this function

children_migrate(hub_id, children_nodes, opts)

View Source
@spec children_migrate(ProcessHub.hub_id(), [{node(), [map()]}], keyword()) :: :ok

Sends the coordinator process a message to start the child processes passed in.

Link to this function

children_start(hub_id, children_nodes, opts)

View Source
@spec children_start(ProcessHub.hub_id(), [{node(), [map()]}], keyword()) :: :ok

Sends the coordinator process a message to start the child processes passed in.

@TODO: should use the underlying PubSub or Gossip.

Link to this function

children_stop(hub_id, children_nodes, stop_opts)

View Source
@spec children_stop(
  ProcessHub.hub_id(),
  [{node(), [ProcessHub.child_id()]}],
  keyword()
) :: :ok

Sends the coordinator process a message to stop the child processes passed in.

Link to this function

propagate_event(hub_id, event_id, event_data, opts \\ %{})

View Source
@spec propagate_event(ProcessHub.hub_id(), atom(), term(), %{
  optional(:discard_event) => boolean(),
  optional(:members) => :global | :local | :external | [node()],
  optional(:priority) => integer(),
  optional(:atomic_priority_set) => integer()
}) :: {:ok, :event_discarded | :event_dispatched | :event_queued}

Propagates the event to the event queue.

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.