Optionalpublish: RoomPublisher
Forwards every room broadcast to other replicas. Omit for purely in-process rooms, which is the behavior when no backplane capability is registered.
OptionalonMemberJoined: () => void
Invoked whenever a connection joins any room on this replica. Used to open the backplane transport on demand: a replica with a local member has to be able to RECEIVE, and subscribing does not open a transport.
Discards every room.
Delivers a frame that arrived from another replica to this replica's local members.
A room is looked up but never CREATED here. A remote frame naming a room nobody on this replica has joined has no local audience, and creating one per arriving name would let a cluster-wide namespace grow this replica's room map without bound.
The room the frame was addressed to
The decoded payload
OptionalexceptId: string
Connection ID the originating replica excluded, if any
Removes a connection from every room it belongs to, then discards any room left empty.
Costs O(rooms this connection is in) rather than O(all rooms), which for the overwhelmingly common case — a peer in no rooms at all — is a single failed map lookup.
The connection to evict
Returns the named room, creating it on first use.
Room name
The room
Returns the named room if one already exists, without creating it.
The non-allocating counterpart to RoomRegistry.get. It is a
bare map read by design: it must not touch RoomRegistry.#neverJoined
in either direction, because adding to that set would mark a room already
in use as abandoned, and reclaiming from it on a read path would make a
lookup that promises to change nothing dispose rooms.
Room name
The room, or undefined when no room of that name exists
Owns the set of live rooms, creating them on demand and dropping them once empty.
Since
0.1.0