Quick Start
This is a basic guide to get your first queue working.
Last updated
Was this helpful?
This is a basic guide to get your first queue working.
Last updated
Was this helpful?
Install using npm:
Install using yarn:
Import into your project and add some jobs:
You need to have a Redis service running in your local computer to run these examples successfully. You can read more about Redis connections .
Jobs are added to the queue and can be processed at any time, with at least one Node.js process running a worker:
You can listen to completed (or failed) jobs by attaching listeners to the workers:
You may also access the timestamp of the event, which looks like "1580456039332-0".
For performance reasons, the events emitted by a QueueEvents
instance do not contain the Job
instance, only the jobId
. Use the Job#fromId
method if you need the Job
instance.
There are many other events available, check the or the for more information.
Sometimes you need to listen to all the workers events in a given place, for this you need to use a special class :