Interface TaskOptions<U>

Represents the options for a task

interface TaskOptions<U> {
    bind?: U;
    id?: string;
    priority?: number;
    retryOptions?: RetryOptions;
    retryStrategy?: RetryStrategy;
    weight?: number;
}

Type Parameters

  • U

Hierarchy (View Summary)

Properties

bind?: U

Context to be bind to the task

id?: string

Task identifier, it necessary to identify the task during all the process, for example, when the job is executed, the event with the task identifier will be emitted with the result of the task.

If not provided, the task identifier will be generated automatically.
priority?: number

The priority of the task. A higher value means a higher priority. The default priority is 0.

0
retryOptions?: RetryOptions

Set the options for the retry process of the task

undefined
retryStrategy?: RetryStrategy

Set the strategy to retry the task

RETRY_STRATEGY.RETRY
weight?: number

The weight of the task, this define the number of tokens that the task will consume from the bucket. The default weight is 1.

1