method ISseService.open
ISseService.open(ctx: IRequestContext): ISseConnection

Opens a new SSE connection for the given request context.

Constructs a ReadableStream, captures its controller, sets the SSE response headers on the context's response builder, calls ctx.response.stream(rs) to obtain the HandlerResult, and returns a connection the handler can use to send messages after the handler returns.

Parameters

The current request context

Return Type

The SSE connection with its result

Usage

import { type ISseService } from "common/src/index.ts";