Skip to content
1 min read · 171 words

Interface: GuestEndpointHooks

Defined in: src/batteries/isolation/protocol.ts:279

Hooks GuestEndpoint invokes for the guest server (serve.ts) to react to.

Properties

PropertyTypeDescriptionDefined in
onCall?(id: string, method: string, args: WireValue[], signal: AbortSignal) => voidA call envelope arrived — resolve/reject settle with the method's outcome.src/batteries/isolation/protocol.ts:281
onEnvelope?(dir: "in" | "out", envelope: WireEnvelope) => voidAny envelope was sent (dir: 'out') or received (dir: 'in') — for wire tracing.src/batteries/isolation/protocol.ts:289
onShutdown?() => voidA shutdown envelope arrived.src/batteries/isolation/protocol.ts:287
onStreamCancel?(id: string, reason?: WireValue) => voidA stream:cancel envelope arrived for an open stream id.src/batteries/isolation/protocol.ts:285
onStreamStart?(id: string, stream: string, args: WireValue[], signal: AbortSignal) => voidA stream:start envelope arrived — the handler pushes deltas via the returned sink.src/batteries/isolation/protocol.ts:283