Commanded v0.16.0 Commanded.PubSub behaviour View Source

Pub/sub behaviour for use by Commanded to subcribe to and broadcast messages.

Link to this section Summary

Functions

Return an optional supervisor spec for pub/sub

List tracked PIDs for a given topic

Get the configured pub/sub adapter

Track the current process under the given topic, uniquely identified by key

Callbacks

Broadcasts message on given topic

Return an optional supervisor spec for pub/sub

List tracked PIDs for a given topic

Subscribes the caller to the PubSub adapter’s topic

Track the current process under the given topic, uniquely identified by key

Link to this section Functions

Link to this function broadcast(topic, message) View Source

Return an optional supervisor spec for pub/sub.

Link to this function list(topic) View Source
list(String.t()) :: [{term(), pid()}]

List tracked PIDs for a given topic.

Link to this function pubsub_provider() View Source
pubsub_provider() :: module()

Get the configured pub/sub adapter.

Defaults to a local pub/sub, restricted to running on a single node.

Link to this function track(topic, key) View Source
track(String.t(), term()) :: :ok

Track the current process under the given topic, uniquely identified by key.

Link to this section Callbacks

Link to this callback broadcast(arg0, term) View Source
broadcast(String.t(), term()) :: :ok | {:error, term()}
broadcast(String.t(), term()) :: :ok | {:error, term()}

Broadcasts message on given topic.

Return an optional supervisor spec for pub/sub.

List tracked PIDs for a given topic.

Link to this callback subscribe(atom) View Source
subscribe(atom()) :: :ok | {:error, term()}
subscribe(atom()) :: :ok | {:error, term()}

Subscribes the caller to the PubSub adapter’s topic.

Link to this callback track(arg0, term) View Source
track(String.t(), term()) :: :ok | {:error, term()}

Track the current process under the given topic, uniquely identified by key.