Mead.Deck.ChannelSupervisor (mead v0.1.1)

Copy Markdown View Source

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.

Summary

Functions

Returns a specification to start this module under a supervisor.

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

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

Functions

child_spec(arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

ensure(session_id, options \\ [])

@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(options \\ [])

stop(session_id, supervisor \\ __MODULE__)

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