mindee
    Preparing search index...

    Interface PollingOptions

    Parameters for the internal polling loop in enqueueAndGetInference() .

    Default behavior:

    • initialDelaySec = 2s
    • delaySec = 1.5s
    • maxRetries = 80

    Validation rules:

    • initialDelaySec >= 1
    • delaySec >= 1
    • maxRetries >= 2

    The initialTimerOptions and recurringTimerOptions objects let you pass an AbortSignal or make the timer unref-ed to the setTimeout().

    const params = {
    initialDelaySec: 4,
    delaySec: 2,
    maxRetries: 50
    };

    const inference = await client.enqueueAndGetInference(inputDoc, params);
    interface PollingOptions {
        delaySec?: number;
        initialDelaySec?: number;
        initialTimerOptions?: { ref?: boolean; signal?: AbortSignal };
        maxRetries?: number;
        recurringTimerOptions?: { ref?: boolean; signal?: AbortSignal };
    }
    Index

    Properties

    delaySec?: number

    Interval in seconds between two consecutive polls.

    initialDelaySec?: number

    Number of seconds to wait before the first poll.

    initialTimerOptions?: { ref?: boolean; signal?: AbortSignal }

    Options passed to the initial setTimeout().

    maxRetries?: number

    Maximum number of polling attempts (including the first one).

    recurringTimerOptions?: { ref?: boolean; signal?: AbortSignal }

    Options passed to every recurring setTimeout().