Overview
WorkerOptions extends QueueBaseOptions and provides configuration for Worker instances.Interface
Properties
connection
Options for connecting to a Redis instance
name
Optional worker name stored on every job processed by this worker
autorun
Whether to start processing jobs automatically on instantiation
concurrency
Number of jobs that a single worker can process in parallel
limiter
Rate limiter configuration
metrics
Metrics collection configuration
maximumRateLimitDelay
Maximum time in milliseconds where the job is idle while being rate limited
maxStartedAttempts
Maximum number of times a job can start processing before being moved to failed
maxStalledCount
Number of times a job can be recovered from stalled state before moving to failed
stalledInterval
Number of milliseconds between stallness checks
removeOnComplete
Specifies max age and/or count of jobs to keep when completed
removeOnFail
Specifies max age and/or count of jobs to keep when failed
skipStalledCheck
Skip stalled check for this worker
skipLockRenewal
Skip automatic lock renewal for this worker
drainDelay
Number of seconds to long poll for jobs when the queue is empty
lockDuration
Duration of the lock for the job in milliseconds
lockRenewTime
Time in milliseconds before the lock is automatically renewed (default: lockDuration / 2)
runRetryDelay
Internal option for retry delay
settings
Advanced worker settings including custom backoff strategies
useWorkerThreads
Use Worker Threads instead of Child Processes for sandboxed processors
Examples
Basic Worker
With Concurrency
With Rate Limiter
With Auto-Cleanup
Named Worker
With Sandboxed Processor
With Custom Stalled Settings
Manual Run
KeepJobs Type
Related Interfaces
- QueueOptions - Configuration for Queues
- JobOptions - Configuration for individual jobs
