Mead.Session.Pool (mead v0.1.1)

Copy Markdown View Source

Dynamically starts and stops the per-conversation supervisors.

The number of live sessions is bounded by :maximum_sessions (the option of start_link/1, then config :mead, :maximum_sessions, then 1000); a session beyond it is refused with {:error, :max_children} instead of growing the node without limit.

Summary

Functions

Returns a specification to start this module under a supervisor.

Starts the supervisor pair for the conversation described by options.

Stops a conversation's supervisor pair; a stored conversation stays on disk.

Functions

child_spec(arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

start_link(options \\ [])

@spec start_link(keyword()) :: Supervisor.on_start()

start_session(options, pool \\ __MODULE__)

Starts the supervisor pair for the conversation described by options.

stop_session(session_id)

@spec stop_session(String.t()) :: :ok | {:error, :not_found}

Stops a conversation's supervisor pair; a stored conversation stays on disk.