Documentation / @super-line/server / CollectionRuntime
Interface: CollectionRuntime
Defined in: collections/index.ts:37
The Collection runtime: the server-side authority for contract-declared Collections, spanning both consistency models. One Collection concept with mode-specific behaviour — not a merger of the two persistence seams, which stay separate backends by construction.
Everything a caller must know is here: the server hands it frames off the wire, relayed payloads off the Adapter, and a connection's departure; it hands back the server-authoritative handle behind srv.collection(n) and the shapes the inspector reports. It never reaches back into the server.
Properties
coordination?
readonlyoptionalcoordination?:"local"|"cluster"
Defined in: collections/index.ts:61
relaysRows
readonlyrelaysRows:boolean
Defined in: collections/index.ts:65
True when a relay row backend needs this node subscribed to COLL_CHANNEL.
Methods
batch()
batch(
ops):Promise<void>
Defined in: collections/index.ts:59
Apply one schema-validated, policy-free server batch atomically across row collections.
Parameters
ops
Returns
Promise<void>
conditionalBatch()
conditionalBatch(
conditions,ops):Promise<boolean>
Defined in: collections/index.ts:60
Parameters
conditions
ops
Returns
Promise<boolean>
detach()
detach(
conn):void
Defined in: collections/index.ts:55
Forget a departing connection's subscriptions (its channel memberships are the host's business).
Parameters
conn
Returns
void
handle()
handle(
name):unknown
Defined in: collections/index.ts:57
The handle behind srv.collection(n) — row or CRDT, chosen by the contract. Throws if undeclared.
Parameters
name
string
Returns
unknown
infos()
infos():
CollectionInfoLite[]
Defined in: collections/index.ts:63
Every declared collection's shape, for the inspector.
Returns
CollectionInfoLite[]
onBatch()
onBatch(
conn,frame):Promise<void>
Defined in: collections/index.ts:43
cbat — an atomic row batch: validated, policy-guarded, applied, fanned out, relayed.
Parameters
conn
frame
Returns
Promise<void>
onCrdtClose()
onCrdtClose(
conn,frame):void
Defined in: collections/index.ts:49
cdclose — leave a document's fan-out channel.
Parameters
conn
frame
Returns
void
onCrdtOpen()
onCrdtOpen(
conn,frame):Promise<void>
Defined in: collections/index.ts:45
cdopen — open a CRDT document (server-authoritative creation means a missing doc is NOT_FOUND).
Parameters
conn
frame
Returns
Promise<void>
onCrdtRelay()
onCrdtRelay(
channel,payload):void
Defined in: collections/index.ts:53
A relayed CRDT delta/delete off a d:<n>:<id> channel.
Parameters
channel
string
payload
string | Uint8Array<ArrayBufferLike>
Returns
void
onCrdtWrite()
onCrdtWrite(
conn,frame):Promise<void>
Defined in: collections/index.ts:47
cdwr — a CRDT delta: policy-guarded, then validate-before-commit at this ingress node.
Parameters
conn
frame
Returns
Promise<void>
onRelay()
onRelay(
payload):void
Defined in: collections/index.ts:51
A relayed row batch off COLL_CHANNEL.
Parameters
payload
string | Uint8Array<ArrayBufferLike>
Returns
void
onSub()
onSub(
conn,frame):Promise<void>
Defined in: collections/index.ts:39
csub — subscribe to a row collection; replies with the policy-filtered initial snapshot.
Parameters
conn
frame
Returns
Promise<void>
onUnsub()
onUnsub(
conn,frame):void
Defined in: collections/index.ts:41
cuns — drop one row subscription.
Parameters
conn
frame
Returns
void