OptionalbatchOptionalgroupAffinity?: booleanOptionalminSize?: numberMinimum 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?: numberAmount of jobs that can be fetched at once as a batch.
Optionaltimeout?: numberThe 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.
OptionalgroupOptionalttl
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
minSizeis also defined, the worker will wait until the selected group has at leastminSizejobs before fetching the batch. Iftimeoutis also defined, the worker will fetch whatever jobs are available in that group after the timeout expires, even ifminSizeis not reached.