Compatibility class
The Queue3
class is targeted to simplify migration of projects based on Bull 3. Though it does not offer 100% API and functional compatibility, upgrading to BullMQ with this class should be easier for users familiar with Bull 3.
Differences in interface include
fixed order of
add()
andprocess()
method argumentsclass instantiation requires use of the
new
operatorinterfaces for Queue and Job options and Job class do not have wrappers and are used directly
there's no
done
argument expected inprocess()
callback anymore; now the callback must always return aPromise
objectname property is mandatory in
add()
methodconcurrency is moved from
process()
argument to queue options
Functional differences generally include only the absence of named processors feature and minor changes in local and global events set. The mandatory name
property in add()
method can contain any string and gets saved to Redis as is. When a job is in progress, you can read this value using job.name
(job.data
and job.id
are available as usual). See the [link] for details.
The all-in-one example:
Read more:
Last updated