Avena Webapp API - v0.0.1
    Preparing search index...

    Interface ExportStreamOptions

    Optional callbacks and timeout for downloadExportViaNats.

    interface ExportStreamOptions {
        idleTimeoutMs?: number;
        onChunk?: (data: Uint8Array) => void | Promise<void>;
        onProgress?: (received: number) => void;
        onSummary?: (missingChannels: number[]) => void;
        signal?: AbortSignal;
    }
    Index

    Properties

    idleTimeoutMs?: number

    Longest wait between two reply messages, in milliseconds. The timer restarts on every message. Default: 600000 (10 minutes).

    onChunk?: (data: Uint8Array) => void | Promise<void>

    Receives the bytes of each chunk frame, in arrival order, instead of the chunks being collected into the result's Blob. The call is awaited before the chunk is acknowledged, so a slow consumer (a file on a slow disk) slows the exporter down instead of data piling up in memory. The result then has an empty blob and streamed: true. If it throws or rejects, the export fails with that error and a cancel message is sent to the exporter.

    onProgress?: (received: number) => void

    Called after each chunk is stored and acked, with the total bytes received so far.

    onSummary?: (missingChannels: number[]) => void

    Called on the summary frame with its missing channels (empty if absent).

    signal?: AbortSignal

    Cancels the download when aborted: a cancel message is published on the ack subject so the exporter stops before its next chunk, no further frames are read or acknowledged, the reply subscription is released, and the call rejects with an error named AbortError (see isExportCancelled). An exporter that predates the cancel message counts it as one ack and stops when its acks time out.