@tabcat/zzzync
    Preparing search index...

    Interface CreateHandlerOptions

    Timing constraints for a handler.

    interface CreateHandlerOptions {
        callbackTimeoutMs?: number;
        handshakeTimeoutMs?: number;
        idleTimeoutMs?: number;
        maxAuthFrameBytes?: number;
        maxBufferSize?: number;
        maxStreamMs?: number;
        minBytesPerSecond?: number;
        rateWindowMs?: number;
    }

    Hierarchy

    • Partial<StreamSignalOptions>
    • AuthOptions
      • CreateHandlerOptions
    Index
    callbackTimeoutMs?: number

    Deadline (ms) applied to each application callback: allow.multihash, allow.record and onReceive. Through authenticateDialer alone only allow.multihash is reached.

    The callbacks are raced rather than awaited, so this holds whether or not one honours the signal it is handed. It is a hang guard rather than a latency budget: it frees the handler and the stream, while a losing callback keeps running and its result is discarded.

    handshakeTimeoutMs?: number

    Wall-clock cap on the handshake, retired by beginTransfer.

    idleTimeoutMs?: number

    Abort if no bytes arrive at all for this long. Applies to both phases.

    maxAuthFrameBytes?: number

    Max bytes for the dialer's optional auth frame. Defaults to DEFAULT_MAX_AUTH_FRAME_BYTES.

    maxBufferSize?: number

    Bytes byteStream may hold before it discards the buffer. It has no backpressure, so the buffer grows as fast as the sender writes. Passed straight through, and worth setting above CarLimits.maxByteLength: the sender runs ahead of the importer, and a buffer that fills first loses the bytes it was holding rather than failing on the limit that was broken.

    Defaults to byteStream's own default of 4MiB.

    maxStreamMs?: number

    Wall-clock backstop for the receive phase, not reset by activity. Cleared once the remote closes its write side.

    minBytesPerSecond?: number

    Bytes per second a transfer must sustain once beginTransfer is called. 0 is how you ask for no floor at all.

    rateWindowMs?: number

    Window the floor is sampled over.