Attach a WebSocket to a known record. Returns false if id is unknown.
(
recordId: string,
ws: WebSocket,
cols: number,
rows: number,
since: number | undefined,
claim?: SessionControllerClaim,
)
| 125 | |
| 126 | /** Attach a WebSocket to a known record. Returns false if id is unknown. */ |
| 127 | attachById( |
| 128 | recordId: string, |
| 129 | ws: WebSocket, |
| 130 | cols: number, |
| 131 | rows: number, |
| 132 | since: number | undefined, |
| 133 | claim?: SessionControllerClaim, |
| 134 | ): SessionAttachResult | { readonly ok: false; readonly reason: 'missing' } { |
| 135 | const session = this.sessions.get(recordId); |
| 136 | if (!session) return { ok: false, reason: 'missing' }; |
| 137 | return session.attach(ws, cols, rows, since, claim); |
| 138 | } |
| 139 | |
| 140 | get(recordId: string): PersistentSession | undefined { |
| 141 | return this.sessions.get(recordId); |
no test coverage detected