An object that contains an AbortSignal as the optional signal property.

Example

const controller = new AbortController()

aLongRunningOperation({
signal: controller.signal
})

// later

controller.abort()
interface MultistreamSelectInit {
    log: Logger;
    maxDataLength?: number;
    maxLengthLength?: number;
    negotiateFully?: boolean;
    signal?: AbortSignal;
    yieldBytes?: boolean;
    lengthDecoder?(data): number;
    lengthEncoder?(value): Uint8Array | Uint8ArrayList;
}

Hierarchy (view full)

Properties

log: Logger
maxDataLength?: number
maxLengthLength?: number
negotiateFully?: boolean

When false, and only a single protocol is being negotiated, use optimistic select to send both the protocol name and the first data buffer in the initial message, saving a round trip for connection establishment.

Default

true
signal?: AbortSignal
yieldBytes?: boolean

After the stream is unwrapped, any bytes that have been read from the incoming stream will be yielded in-order as Uint8Array(s).

To yield a single Uint8ArrayList with all unread bytes instead, pass false here.

Methods

  • Parameters

    Returns number