Rooms are named communication channels that let you send messages to a subset of connected clients instead of broadcasting to everyone. A single client can be a member of multiple rooms at the same time — for example, a chat user might be inDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/foxytp/stelar-time-real/llms.txt
Use this file to discover all available pages before exploring further.
general, project-alpha, and a private direct-message room simultaneously. When the last member leaves a room or disconnects, stelar-time-real automatically removes the room from memory with no manual cleanup required.
Server-side room operations
Joining and leaving
Inside any event handler or middleware, use the context methods to move a client in and out of rooms:| Method | Description |
|---|---|
ctx.joinRoom(room) | Add this client to the named room |
ctx.leaveRoom(room) | Remove this client from the named room |
Sending to a room
Inspecting rooms
Example: joining a channel and notifying members
joinChannel with { channel: 'general' }, the server adds them to general and broadcasts a userJoined event to everyone already in that room.
Example: broadcasting a message to all of a client’s rooms
ctx.clientInfo.rooms is a Set<string> of all room names the client is currently a member of. Iterating it lets you fan a single event out to every room the sender belongs to.
Client-side room operations
joinRoom on the client sends a join frame to the server, which processes it and adds the client to the room. The server emits a joined-room event back to the client confirming the join.
Limiting room membership
Control how many rooms can exist globally and per client through the server options:Rooms are cleaned up automatically when the last client leaves or disconnects. You never need to manually delete a room — stelar-time-real tracks membership internally and removes the room entry as soon as its member set is empty.
