This class represents a worker that is able to process jobs from the queue. As soon as the class is instantiated and a connection to Redis is established it will start processing jobs.
The name of the queue.
Options for the queue.
Returns the version of the Redis instance the client is connected to,
Closes the worker and related redis connections.
This method waits for current jobs to finalize before returning.
Use force boolean parameter if you do not want to wait for current jobs to be processed.
Promise that resolves when the worker has been closed.
This function is exposed only for testing purposes.
Force disconnects a connection.
Checks if worker is paused.
true if worker is paused, false otherwise.
Checks if worker is currently running.
true if worker is running, false otherwise.
Pauses the processing of this queue only for this worker.
Overrides the rate limit to be active for the next jobs.
expire time in ms of this rate limit.
Resumes processing of this worker (if paused).
Manually starts the stalled checker. The check will run once as soon as this method is called, and then every opts.stalledInterval milliseconds until the worker is closed. Note: Normally you do not need to call this method, since the stalled checker is automatically started when the worker starts processing jobs after calling run. However if you want to process the jobs manually you need to call this method to start the stalled checker.
Waits until the worker is ready to start processing jobs. In general only useful when writing tests.
Generated using TypeDoc