Mead.Session (mead v0.1.1)

Copy Markdown View Source

Registry helpers shared by the processes that make up one conversation.

Every conversation owns three registered processes, its :supervisor, a :history keeper, and a :server, all found under Mead.Registry by {role, session_id}.

Summary

Functions

Returns the :via name under which a conversation's process registers itself.

Returns the pid registered for a conversation's role, or nil when there is none.

Types

role()

@type role() :: :supervisor | :history | :server

Functions

via(session_id, role)

@spec via(String.t(), role()) :: {:via, Registry, {atom(), {role(), String.t()}}}

Returns the :via name under which a conversation's process registers itself.

whereis(session_id, role)

@spec whereis(String.t(), role()) :: pid() | nil

Returns the pid registered for a conversation's role, or nil when there is none.