Beignet API reference
    Preparing search index...

    Interface ServerSentEventStream

    Controls exposed while an SSE response is active.

    interface ServerSentEventStream {
        signal: AbortSignal;
        close(): void;
        comment(value?: string): boolean;
        send<TData>(message: ServerSentEventMessage<TData>): boolean;
    }
    Index
    signal: AbortSignal

    Aborts whenever this stream closes, including response cancellation. Async setup should pass it to cancellable subscription APIs.

    • Close the stream and run its cleanup exactly once.

      Returns void

    • Send an SSE comment. Comments are useful as connection heartbeats.

      Returns false when the stream is no longer writable or its unread byte limit would be exceeded.

      Parameters

      • Optionalvalue: string

      Returns boolean

    • Send a JSON-encoded event.

      Returns false after the stream closes, when encoding fails, or when the unread byte limit would be exceeded.

      Type Parameters

      • TData

      Parameters

      Returns boolean