@flux-control/effect-modbus-rs
    Preparing search index...

    Interface ModbusRetryPolicyOptions

    Options accepted by makeRetryPolicy and by every preset in RetryPolicies.

    Nothing here is applied automatically — a policy only takes effect once it is attached to a transport, to a client, or piped over an effect with retryModbus. Library defaults stay single-shot so that timing is predictable unless retries are explicitly opted into.

    These are application-level retries, and the only ones in play: the transport-level knobs modbus-rs offers are withheld from every transport constructor in this package, so the two layers cannot be combined by accident. See UpstreamRetryOptionKey in src/shared-transport.ts.

    interface ModbusRetryPolicyOptions {
        baseDelay?: DurationInput;
        errors?: Partial<
            Record<
                | "ModbusExceptionError"
                | "ModbusTimeoutError"
                | "ModbusTransportError"
                | "ModbusInvalidArgumentError"
                | "ModbusConnectionClosedError"
                | "ModbusInternalError"
                | "ModbusNotConnectedError"
                | "ModbusCircuitOpenError",
                RetryErrorOptions,
            >,
        >;
        factor?: number;
        jitter?: boolean
        | { max?: number; min?: number };
        maxDelay?: DurationInput;
        maxElapsed?: DurationInput;
        maxRetries?: number;
        retryableExceptions?: readonly number[];
    }
    Index
    baseDelay?: DurationInput

    Policy-level delay before the first retry. Default 100 millis.

    errors?: Partial<
        Record<
            | "ModbusExceptionError"
            | "ModbusTimeoutError"
            | "ModbusTransportError"
            | "ModbusInvalidArgumentError"
            | "ModbusConnectionClosedError"
            | "ModbusInternalError"
            | "ModbusNotConnectedError"
            | "ModbusCircuitOpenError",
            RetryErrorOptions,
        >,
    >

    Which ModbusError variants are retryable, with optional per-error backoff overrides.

    Defaults retry the errors that a healthy bus recovers from on its own — ModbusTimeoutError, ModbusTransportError, ModbusConnectionClosedError, and the transient exception codes in retryableExceptionCodes — and never retry ModbusInvalidArgumentError, ModbusNotConnectedError, or ModbusInternalError.

    factor?: number

    Policy-level backoff multiplier. Default 2.

    jitter?: boolean | { max?: number; min?: number }

    Randomness applied to each delay, as a multiplier range.

    true (default) uses Effect's 0.8 – 1.2 range; false disables jitter; an object customises the range. Jitter keeps a fleet of pollers from re-hitting a recovering device in lockstep.

    Schedule.jitteredWith — The underlying combinator.

    maxDelay?: DurationInput

    Policy-level delay ceiling. Default 5 seconds.

    maxElapsed?: DurationInput

    Wall-clock budget for the whole retry sequence. Unbounded by default.

    maxRetries?: number

    Maximum number of retries (attempts = maxRetries + 1). Default 3.

    retryableExceptions?: readonly number[]

    Modbus exception codes worth retrying when the device answers with an exception response. Default retryableExceptionCodes.

    Only consulted when ModbusExceptionError is retryable at all.