Class FalStream<Input, Output>

The class representing a streaming response. With t

Type Parameters

  • Input
  • Output

Constructors

Properties

config: Required<Config>
endpointId: string
options: StreamOptions<Input>
url: string

Accessors

  • get requestId(): string
  • Gets the request id of the streaming request.

    Returns string

    the request id.

Methods

  • Aborts the streaming request.

    Note: This method is noop in case the request is already done.

    Parameters

    • Optionalreason: string | Error

      optional cause for aborting the request.

    Returns void

  • Gets a reference to the Promise that indicates whether the streaming is done or not. Developers should always call this in their apps to ensure the request is over.

    An alternative to this, is to use on('done') in case your application architecture works best with event listeners.

    Returns Promise<Output>

    the promise that resolves when the request is done.

  • Parameters

    • type: FalStreamEventType
    • listener: EventHandler<any>

    Returns void