View Source Commanded.PubSub (Commanded v1.4.3)

Use the pubsub configured for a Commanded application.

Summary

Functions

Get the configured pub/sub adapter.

Broadcasts message on given topic.

Subscribes the caller to the PubSub adapter's topic.

Types

@type application() :: Commanded.Application.t()
@type config() :: Keyword.t() | atom()

Functions

Link to this function

adapter(application, config)

View Source
@spec adapter(application(), config()) :: {module(), config()}

Get the configured pub/sub adapter.

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

Link to this function

broadcast(application, topic, message)

View Source

Broadcasts message on given topic.

  • topic - The topic to broadcast to, ie: "users:123"
  • message - The payload of the broadcast
Link to this function

subscribe(application, topic)

View Source

Subscribes the caller to the PubSub adapter's topic.