# `Mead.Deck.ChannelSupervisor`
[🔗](https://github.com/albertosca/mead/blob/main/lib/mead/deck/channel_supervisor.ex#L1)

Starts and stops the `Mead.Deck.Channel` of each session. A channel is `:temporary`: when it
stops, a reconnecting deck asks for a new one through `ensure/2`, and the event log it keeps on
disk carries the sequence over.

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `ensure`

```elixir
@spec ensure(String.t(), keyword()) :: {:ok, pid()} | {:error, term()}
```

Returns the channel of `session_id`, starting it when there is none.

## Options

  * `:configuration` - the `Mead.Deck.Configuration` to use (required).
  * `:storage_directory` - where the event log lives; defaults to the session storage
    directory, and `nil` keeps the log in memory.

# `start_link`

# `stop`

```elixir
@spec stop(String.t(), Supervisor.supervisor()) :: :ok
```

Stops the channel of a session and waits until it is gone; no channel is not an error.

---

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