@vgerbot/async
    Preparing search index...

    Interface TransformOptions<R>

    Options for configuring cancellable task behavior.

    interface TransformOptions<R = unknown> {
        concurrency?: number;
        fallback?:
            | R
            | Promise<R>
            | ((error: unknown, isCancelled: boolean) => Promise<R>);
        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

    • R = unknown

    Hierarchy (View Summary)

    Index

    Properties

    concurrency?: number
    fallback?:
        | R
        | Promise<R>
        | ((error: unknown, isCancelled: boolean) => Promise<R>)

    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".