@vgerbot/async
    Preparing search index...

    Interface AutoResolveOptions<TResults>

    Options for configuring cancellable task behavior.

    interface AutoResolveOptions<TResults extends Record<string, unknown>> {
        concurrency?: number;
        errorMode: "resolve";
        fallback?:
            | AutoResolveResult<TResults>
            | Promise<AutoResolveResult<TResults>>
            | (
                (
                    error: unknown,
                    isCancelled: boolean,
                ) => Promise<AutoResolveResult<TResults>>
            );
        name?: string;
        onCancel?: (error: CancelError) => void | Promise<void>;
        onRetry?: (
            info: {
                attempt: number;
                error: Error;
                maxAttempts: number;
                waitMs: number;
            },
        ) => void
        | Promise<void>;
        retry?: RetryOptions;
        signal?: AbortSignal;
        timeout?: number;
    }

    Type Parameters

    • TResults extends Record<string, unknown>

    Hierarchy (View Summary)

    Index

    Properties

    concurrency?: number
    errorMode: "resolve"
    fallback?:
        | AutoResolveResult<TResults>
        | Promise<AutoResolveResult<TResults>>
        | (
            (
                error: unknown,
                isCancelled: boolean,
            ) => Promise<AutoResolveResult<TResults>>
        )

    Fallback value/provider used when the task rejects. Receives the original error and whether it was caused by cancellation.

    name?: string

    Optional name for tracing and diagnostics

    onCancel?: (error: CancelError) => void | Promise<void>

    Callback invoked when the task is cancelled. Receives the resolved CancelError.

    onRetry?: (
        info: {
            attempt: number;
            error: Error;
            maxAttempts: number;
            waitMs: number;
        },
    ) => void
    | Promise<void>

    Callback invoked right before waiting for a retry attempt.

    retry?: RetryOptions

    Retry configuration for the task

    signal?: AbortSignal

    External AbortSignal to link with the task's cancellation

    timeout?: number

    Timeout in milliseconds. The task will be automatically cancelled after this duration, with the cancel reason set to a string in the form "{label} timeout after {timeout}ms".