# `Cauldron2D.World.Presence`
[🔗](https://github.com/jaman/cauldron/blob/v0.1.3/cauldron_2d/lib/cauldron_2d/world/presence.ex#L1)

Who comes and goes in every world on the node, told to whoever asks.

    Cauldron2D.World.Presence.subscribe()
    receive do
      {:cauldron_players, world, :joined, id} -> ...
      {:cauldron_players, world, :left, id} -> ...
    end

A subscribed process is sent a message for every join and leave in every
`Cauldron2D.World` until it unsubscribes or exits; `world` is the world's pid.

# `broadcast`

```elixir
@spec broadcast(pid(), :joined | :left, term()) :: :ok
```

Tell every subscriber that `id` joined or left the world `world`.

# `subscribe`

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

Receive every world's joins and leaves in the calling process.

# `unsubscribe`

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

Stop receiving them.

---

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