libp2p
    Preparing search index...

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

    const controller = new AbortController()

    aLongRunningOperation({
    signal: controller.signal
    })

    // later

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

    Hierarchy (View Summary)

    Index

    Properties

    lengthDecoder?: (data: Uint8ArrayList) => number
    lengthEncoder?: (value: number) => Uint8Array<ArrayBufferLike> | Uint8ArrayList
    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.

    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.