Skip to content

Documentation / @super-line/server / CollectionConn

Interface: CollectionConn

Defined in: collections/types.ts:34

Everything the Collection runtime needs from a connection — the whole of it. The server's Conn class satisfies this structurally, so nothing adapts at the call site; stating it as its own interface is what lets a test hand the runtime an object literal instead of a socket, and records that collections touch none of Conn's heartbeat state or its raw transport.

Properties

ctx

readonly ctx: unknown

Defined in: collections/types.ts:37


id

readonly id: string

Defined in: collections/types.ts:35


principal?

readonly optional principal?: string

Defined in: collections/types.ts:39

The ACL identity (identify(conn) ?? conn.id); always set once the connection is accepted.


role

readonly role: string

Defined in: collections/types.ts:36

Methods

send()

send(frame): void

Defined in: collections/types.ts:40

Parameters

frame

unknown

Returns

void


sendRaw()

sendRaw(payload): void

Defined in: collections/types.ts:42

Send pre-encoded bytes — one buffer to N connections, no re-encode per recipient.

Parameters

payload

string | Uint8Array<ArrayBufferLike>

Returns

void

Released under the MIT License.