Who is logged in on the node, by whatever kind of client, told to whoever asks.
Cauldron2D.Sessions.track("alice", :terminal)
Cauldron2D.Sessions.list()
#=> [%{id: "alice", kind: :terminal, since: 1789718400, pid: #PID<0.312.0>}]
Cauldron2D.Sessions.subscribe()
receive do
{:cauldron_sessions, :opened, session} -> ...
{:cauldron_sessions, :closed, session} -> ...
endA session is the calling process — a client on an ssh connection, a page in a
browser — listed from track/2 until the process exits or tracks again. kind is
whatever the client calls itself. A subscribed process hears every opening and closing
until it unsubscribes or exits.
Summary
Functions
Returns a specification to start this module under a supervisor.
Every session on the node, oldest first.
Receive every opening and closing in the calling process.
List the calling process as a session of id, of this kind, until it exits.
Stop receiving them.
Types
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec list() :: [session()]
Every session on the node, oldest first.
@spec subscribe() :: :ok
Receive every opening and closing in the calling process.
List the calling process as a session of id, of this kind, until it exits.
@spec unsubscribe() :: :ok
Stop receiving them.