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

Pub/sub adapter using Phoenix's distributed pub/sub and presence platform.

To use Phoenix pub/sub you must add it as a dependency in your project's
`mix.exs` file:

    defp deps do
      [
        {:phoenix_pubsub, "~> 1.0"}
      ]
    end

Fetch mix deps and configure the pubsub settings in your environment config
file:

    # `config/config.exs`
    config :my_app, MyApp.Application,
      pubsub: [
        phoenix_pubsub: [
          adapter: Phoenix.PubSub.PG2,
          pool_size: 1
        ]
      ]

Specify the Phoenix pub/sub adapter you wish to use from:

  * `Phoenix.PubSub.PG2` - uses Distributed Elixir, directly exchanging
    notifications between servers

  * `Phoenix.PubSub.Redis` - uses Redis to exchange data between servers

# `broadcast`

Broadcasts message on given topic.

# `child_spec`

Start the configured Phoenix pub/sub adapter and a presence tracker.

# `list`

List tracked terms and associated PIDs for a given topic.

# `subscribe`

Subscribes the caller to the topic.

# `track`

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

---

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