A live SSE connection backed by a ReadableStream.
The connection owns its stream lifecycle (heartbeat interval, controller,
abort listener) and exposes send, comment, and close.
readonly
id: string
Unique connection ID.
readonly
lastEventId: string | null
The client's Last-Event-ID header value, if present.
readonly
isOpen: boolean
Whether this connection is still open.
readonly
result: HandlerResult
The HandlerResult obtained from ctx.response.stream(). The handler
returns this value so the kernel maps it to the correct web response.
send(msg: SseMessage): void
Enqueues an encoded SSE frame for the connected client.
comment(text: string): void
Enqueues a plain-text comment frame (: <text>\n\n) — commonly used as a
keep-alive heartbeat.
close(): void
Closes the connection: clears the heartbeat, closes the stream controller, and marks the connection as closed. Idempotent.