bothy-sdk
    Preparing search index...

    Class GatewaySource

    Events over the gateway; acknowledged with the op ack.

    Implements

    Index

    Constructors

    Properties

    closeReason: CloseReason | undefined

    Why the source stopped, once it has.

    gateway: GatewayLike

    The gateway session.

    onError: ((frame: GatewayEvent) => void) | undefined

    Receives every error frame (a failed op, with a GatewayOpError as model).

    window: AckWindow = ...

    The acknowledgement window.

    Methods

    • Yields the deliveries of the gateway until it stops.

      Returns AsyncGenerator<Delivery, void, undefined>

      The deliveries.

    • Sends the op ack.

      Parameters

      • seq: number

        The highest settled seq.

      Returns Promise<void>

      A promise that resolves once the frame is handed to the socket.

    • Passes on a cursor; it never settles an open delivered event.

      Parameters

      • seq: number

        The cursor.

      Returns Promise<void>

      A promise that resolves after a needed ack.

    • Sends the op command.autocomplete_result.

      Parameters

      • requestId: string

        The request.

      • choices: readonly {}[]

        The choices.

      Returns Promise<void>

      A promise that resolves once the frame is handed to the socket.

      TransportError when the gateway is not connected.

    • Closes the gateway with 1000.

      Returns Promise<void>

      A promise that resolves once the close is started.

    • Marks seq settled and sends ack when the acknowledgement point moves.

      Parameters

      • seq: number

        The settled seq.

      Returns Promise<void>

      A promise that resolves after a needed ack.