@taskforcesh/bullmq-pro - v7.49.0
    Preparing search index...

    Interface WorkerProOptions

    interface WorkerProOptions {
        batch?: {
            groupAffinity?: boolean;
            minSize?: number;
            size?: number;
            timeout?: number;
        };
        group?: GroupMetaOptions;
        ttl?: number
        | JobTtlMap;
    }

    Hierarchy

    • WorkerOptions
      • WorkerProOptions
    Index
    batch?: {
        groupAffinity?: boolean;
        minSize?: number;
        size?: number;
        timeout?: number;
    }

    Type Declaration

    • OptionalgroupAffinity?: boolean

      When enabled, batches will never mix groups: each batch contains either all non-group jobs or all jobs from a single group. Non-group jobs (those in the wait list / prioritized queue) are drained first; once none remain, the worker picks the next group in round-robin order and fills the batch exclusively from that group. If minSize is also defined, the worker will wait until the selected group has at least minSize jobs before fetching the batch. If timeout is also defined, the worker will fetch whatever jobs are available in that group after the timeout expires, even if minSize is not reached.

      false
      
    • OptionalminSize?: number

      Minimum amount of jobs that must be fetched at once as a batch. Note that if there are not enough jobs in the queue, the worker will wait until there are enough jobs to fetch, potentially waiting indefinitely, even if there are some jobs to process, but not enough to reach the minimum size.

    • Optionalsize?: number

      Amount of jobs that can be fetched at once as a batch.

    • Optionaltimeout?: number

      The maximum time in milliseconds to wait for at least minSize jobs to become available when minSize is defined. If this time elapses and the number of available jobs is still less than minSize, the worker will fetch up to size jobs that are currently available. This option allows controlling how long to wait for a batch to reach the minimum size before processing whatever jobs are available.

      undefined (wait indefinitely when minSize > 1)

    ttl?: number | JobTtlMap