class
Obsctl::Server::ClientRegistry
- Obsctl::Server::ClientRegistry
- Reference
- Object
Overview
Tracks IPC clients subscribed to pushed state, event, and log topics.
Defined in:
obsctl/server/client_registry.crConstant Summary
-
ALLOWED_TOPICS =
Set {"state", "events", "logs"}
Constructors
-
.new
Creates an empty registry.
Instance Method Summary
-
#add(session : IPC::ClientSession, topics : Array(String)) : Nil
Adds or replaces a subscription for a connected client session.
-
#broadcast(topic : String, data : JSON::Any | Nil = nil) : Nil
Broadcasts a topic event to all matching subscribers.
-
#client_count : Int32
Returns the current number of registered client sessions.
-
#remove(session : IPC::ClientSession) : Nil
Removes a client session from the registry.
Constructor Detail
Instance Method Detail
def add(session : IPC::ClientSession, topics : Array(String)) : Nil
#
Adds or replaces a subscription for a connected client session.
def broadcast(topic : String, data : JSON::Any | Nil = nil) : Nil
#
Broadcasts a topic event to all matching subscribers.