bullmq - v5.56.2
    Preparing search index...

    Interface WorkerOptions

    Base Queue options

    interface WorkerOptions {
        autorun?: boolean;
        blockingConnection?: boolean;
        concurrency?: number;
        connection: ConnectionOptions;
        drainDelay?: number;
        limiter?: RateLimiterOptions;
        lockDuration?: number;
        lockRenewTime?: number;
        maxStalledCount?: number;
        metrics?: MetricsOptions;
        name?: string;
        prefix?: string;
        removeOnComplete?: KeepJobs;
        removeOnFail?: KeepJobs;
        runRetryDelay?: number;
        settings?: AdvancedOptions;
        skipLockRenewal?: boolean;
        skipStalledCheck?: boolean;
        skipVersionCheck?: boolean;
        skipWaitingForReady?: boolean;
        stalledInterval?: number;
        telemetry?: Telemetry;
        useWorkerThreads?: boolean;
        workerForkOptions?: ForkOptions;
        workerThreadsOptions?: WorkerOptions;
    }

    Hierarchy (View Summary)

    Index

    Properties

    autorun?: boolean

    Condition to start processor at instance creation.

    true
    
    blockingConnection?: boolean

    Denotes commands should retry indefinitely.

    not in use anymore.

    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.

    5
    

    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.

    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.

    1
    
    metrics?: MetricsOptions

    Enable collect metrics.

    name?: string

    Optional worker name. The name will be stored on every job processed by this worker instance, and can be used to monitor which worker is processing or has processed a given job.

    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.

    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)

    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.

    false
    
    skipVersionCheck?: boolean

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

    false
    
    skipWaitingForReady?: boolean

    Skip waiting for connection ready.

    In some instances if you want the queue to fail fast if the connection is not ready you can set this to true. This could be useful for testing and when adding jobs via HTTP endpoints for example.

    stalledInterval?: number

    Number of milliseconds between stallness checks.

    30000
    
    telemetry?: Telemetry

    Telemetry Addon

    useWorkerThreads?: boolean

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

    false
    
    workerForkOptions?: ForkOptions

    Support passing Worker Fork Options. Note: This option can only be used when specifying a file for the processor argument and useWorkerThreads is passed as false (default value).

    workerThreadsOptions?: WorkerOptions

    Support passing Worker Threads Options. Note: This option can only be used when specifying a file for the processor argument and useWorkerThreads is passed as true.