Libraries
    Preparing search index...

    Interface Subscription<TOutgoing, TIncoming>

    A live WebSocket subscription handle returned by client.group.endpoint().

    Implements AsyncIterable for consuming server-sent events and provides send() for client→server messages when the subscription is bidirectional.

    interface Subscription<TOutgoing, TIncoming = never> {
        state: "connecting" | "connected" | "reconnecting" | "closed";
        "[asyncIterator]"(): AsyncIterator<TOutgoing, any, any>;
        close(): void;
        send(message: TIncoming): void;
    }

    Type Parameters

    • TOutgoing
    • TIncoming = never

    Hierarchy

    Index

    Properties

    Methods

    Properties

    state: "connecting" | "connected" | "reconnecting" | "closed"

    Current connection state.

    Methods

    • Returns AsyncIterator<TOutgoing, any, any>