Theia API Documentation v1.76.0
    Preparing search index...

    Serves data as server-sent events to the clients of an external API endpoint.

    The stream manages the connected clients, sends periodic keep-alive comments, delivers the configured snapshot to connecting clients, and broadcasts, coalescing bursts, a fresh snapshot when notifyChanged is called. Disposing the stream ends all client connections; streams created through ExternalApiRouter#eventStream are disposed automatically when the routing is rebuilt, so that clients reconnect against the new configuration.

    interface ExternalApiEventStream<T = unknown> {
        clientCount: number;
        dispose(): void;
        handle(request: Request, response: Response): Promise<void>;
        notifyChanged(): void;
        send(data: T): void;
    }

    Type Parameters

    • T = unknown

    Hierarchy (View Summary)

    Implemented by

    Index

    Properties

    clientCount: number

    The number of currently connected clients.

    Methods

    • Dispose this object.

      Returns void

    • Serves the event stream to a client; registered as the route's request handler by ExternalApiRouter#eventStream.

      Parameters

      • request: Request
      • response: Response

      Returns Promise<void>