# `Bourse.WS.Broadcast`
[🔗](https://github.com/ZenHive/bourse/blob/main/lib/bourse/ws/broadcast.ex#L1)

Registry-backed fan-out for routed WS adapter messages.

# `topic`

```elixir
@type topic() :: {String.t(), atom(), String.t() | nil}
```

# `broadcast`

```elixir
@spec broadcast(topic(), term()) :: :ok
```

Dispatches a message to all subscribers of a topic.

# `child_spec`

```elixir
@spec child_spec() :: Supervisor.child_spec()
```

Child spec for the duplicate-key Registry.

# `subscribe`

```elixir
@spec subscribe(topic()) :: :ok
```

Registers the calling process for a topic.

# `topic`

```elixir
@spec topic(String.t(), atom(), String.t() | nil) :: topic()
```

Builds a broadcast topic from exchange id, family, and optional channel.

# `unsubscribe`

```elixir
@spec unsubscribe(topic()) :: :ok
```

Unregisters the calling process from a topic.

---

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