# `Commanded.PubSub`
[🔗](https://github.com/commanded/commanded/blob/v1.4.12/lib/commanded/pubsub.ex#L1)

Use the pubsub configured for a Commanded application.

# `application`

```elixir
@type application() :: Commanded.Application.t()
```

# `config`

```elixir
@type config() :: Keyword.t() | atom()
```

# `adapter`

```elixir
@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.

# `broadcast`

Broadcasts message on given topic.

  * `topic` - The topic to broadcast to, ie: `"users:123"`
  * `message` - The payload of the broadcast

# `subscribe`

Subscribes the caller to the PubSub adapter's topic.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
