Interface WorkerProOptions

Hierarchy

  • WorkerOptions
    • WorkerProOptions

Properties

autorun?: boolean

Condition to start processor at instance creation.

Default

true
batch?: {
    size?: number;
}

Type declaration

blockingConnection?: boolean

Denotes commands should retry indefinitely.

concurrency?: number

Amount of jobs that a single worker is allowed to work on in parallel.

connection?: ConnectionOptions

Options for connecting to a Redis instance.

drainDelay?: number

Number of seconds to long poll for jobs when the queue is empty.

Default

5
group?: {
    concurrency?: number;
    limit?: {
        duration: number;
        max: number;
    };
}

Type declaration

  • Optional concurrency?: number

    Maximum number of simultaneous jobs that the workers can handle within a specific group. For instance, setting this value to 1 ensures that no more than one job from the same group is processed at any given time. If this limit is not defined, there will be no restriction on the number of concurrent jobs.

  • Optional limit?: {
        duration: number;
        max: number;
    }
    • duration: number
    • max: number
limiter?: RateLimiterOptions

Enable rate limiter

lockDuration?: number

Duration of the lock for the job in milliseconds. The lock represents that a worker is processing the job. If the lock is lost, the job will be eventually be picked up by the stalled checker and move back to wait so that another worker can process it again.

Default

30000
lockRenewTime?: number

The time in milliseconds before the lock is automatically renewed.

It is not recommended to modify this value, which is by default set to halv the lockDuration value, which is optimal for most use cases.

maxStalledCount?: number

Amount of times a job can be recovered from a stalled state to the wait state. If this is exceeded, the job is moved to failed.

Default

1
metrics?: MetricsOptions

Enable collect metrics.

prefix?: string

Prefix for all queue keys.

removeOnComplete?: KeepJobs

You can provide an object specifying max age and/or count to keep. Default behavior is to keep the job in the completed set.

removeOnFail?: KeepJobs

You can provide an object specifying max age and/or count to keep. Default behavior is to keep the job in the failed set.

runRetryDelay?: number

This is an internal option that should not be modified.

Default

15000
settings?: AdvancedOptions

More advanced options.

skipLockRenewal?: boolean

Skip lock renewal for this worker. If set to true, the lock will expire after lockDuration and moved back to the wait queue (if the stalled check is not disabled)

Default

false
skipStalledCheck?: boolean

Skip stalled check for this worker. Note that other workers could still perform stalled checkd and move jobs back to wait for jobs being processed by this worker.

Default

false
skipVersionCheck?: boolean

Avoid version validation to be greater or equal than v5.0.0.

Default Value

false

stalledInterval?: number

Number of milliseconds between stallness checks.

Default

30000
ttl?: number | JobTtlMap
useWorkerThreads?: boolean

Use Worker Threads instead of Child Processes. Note: This option can only be used when specifying a file for the processor argument.

Default

false

Generated using TypeDoc