method RoomRegistry.prototype.evict
RoomRegistry.prototype.evict(conn: IWebSocketConnection): void

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.

Parameters

The connection to evict

Return Type

void

Usage

import { RoomRegistry } from "websocket-plugin/src/index.ts";