durable-execution - v0.32.0
    Preparing search index...

    Type Alias TaskEnqueueOptions<TTask>

    Runtime options for enqueuing a task that override the task's default configuration.

    These options allow you to customize task behavior at enqueue time without changing the task definition. Useful for adjusting timeouts or retry behavior based on runtime conditions.

    // Enqueue with custom timeout for urgent processing
    const handle = await executor.enqueueTask(emailTask, input, {
    timeoutMs: 60_000, // 1 minute instead of default 30s
    retryOptions: {
    maxAttempts: 1, // Don't retry urgent emails
    }
    })

    // Enqueue with delay for rate limiting
    const handle = await executor.enqueueTask(apiTask, input, {
    sleepMsBeforeRun: 5000 // Wait 5 seconds before starting
    })
    type TaskEnqueueOptions<TTask extends AnyTask = AnyTask> = {
        retryOptions?: InferTaskType<TTask> extends "sleepingTask"
            ? never
            : TaskRetryOptions;
        sleepMsBeforeRun?: InferTaskType<TTask> extends "sleepingTask"
            ? never
            : number;
        timeoutMs?: number;
    }

    Type Parameters

    Index

    Properties

    retryOptions?: InferTaskType<TTask> extends "sleepingTask"
        ? never
        : TaskRetryOptions

    Options for retrying the task. Has no effect on sleeping tasks.

    sleepMsBeforeRun?: InferTaskType<TTask> extends "sleepingTask" ? never : number

    The number of milliseconds to wait before running the task. Has no effect on sleeping tasks.

    timeoutMs?: number

    The number of milliseconds after which the task will be timed out.