Creates a room.
The room name
Optionallistener: RoomMembershipListener
Notified on every membership change. Supplied by a
RoomRegistry; omit for a standalone room.
Optionalpublish: RoomPublisher
Forwards broadcasts to other replicas. Omit for a room that stays in-process.
The room name.
Total membership including connections that have since closed.
Number of currently open members.
Adds a connection to this room.
The connection to add
Sends a frame to every open member, skipping any closed member and any
member named by options.except.
Text as string, binary as Uint8Array
Optionaloptions: RoomBroadcastOptions
Broadcast options
Serializes a value to JSON once and broadcasts it as a text frame.
The payload type
The value to serialize
Optionaloptions: RoomBroadcastOptions
Broadcast options
Sends a frame to this replica's own members only, without forwarding it to the backplane.
This is the delivery path for a frame that ARRIVED from another replica:
re-publishing it would echo it back around the cluster forever. Applications
call Room.broadcast; only the plugin's backplane subscriber
calls this.
Exclusion is honored two ways: options.except names a live connection
object (the local path), and options.exceptId names one by ID (the path a
frame arriving from another replica takes, since the excluded connection
object does not exist here).
Text as string, binary as Uint8Array
Optionaloptions: LocalBroadcastOptions
Broadcast options, including exclusion by ID
Removes a connection from this room.
The connection to remove
A named group of connections that can be addressed as one.
Since
0.1.0