The name of the queue.
Options for the queue.
An optional "Connection" class used to instantiate a Connection. This is useful for testing with mockups and/or extending the Connection class and passing an alternate implementation.
Readonly
nameThe name of the queue.
Options for the queue.
Readonly
qualifiedReturns a promise that resolves to a redis client. Normally used only by subclasses.
Returns the version of the Redis instance the client is connected to,
Closes the connection and returns a promise that resolves when the connection is closed.
Returns the number of jobs waiting to be processed. This includes jobs that are "waiting" or "delayed" or "prioritized" or "waiting-children".
Force disconnects a connection.
Emits an event. Normally used by subclasses to emit events.
The emitted event.
Export the metrics for the queue in the Prometheus format. Automatically exports all the counts returned by getJobCounts().
Optional
globalVariables: Record<string, string>Returns the jobs that are in the "active" status.
zero based index from where to start returning jobs.
zero based index where to stop returning jobs.
Returns the number of jobs in active status.
Returns the jobs that are in the "completed" status.
zero based index from where to start returning jobs.
zero based index where to stop returning jobs.
Returns the number of jobs in completed status.
Returns the number of jobs per priority.
Get jobId from deduplicated state.
deduplication identifier
Returns the jobs that are in the "delayed" status.
zero based index from where to start returning jobs.
zero based index where to stop returning jobs.
Returns the number of jobs in delayed status.
Returns the qualified job ids and the raw job data (if available) of the children jobs of the given parent job. It is possible to get either the already processed children, in this case an array of qualified job ids and their result values will be returned, or the pending children, in this case an array of qualified job ids will be returned. A qualified job id is a string representing the job id in a given queue, for example: "bull:myqueue:jobid".
The id of the parent job
"processed" | "pending"
an object with the following shape:
{ items: { id: string, v?: any, err?: string } [], jobs: JobJsonRaw[], total: number}
Returns the jobs that are in the "failed" status.
zero based index from where to start returning jobs.
zero based index where to stop returning jobs.
Returns the number of jobs in failed status.
Job counts by type
Queue#getJobCountByTypes('completed') => completed count Queue#getJobCountByTypes('completed,failed') => completed + failed count Queue#getJobCountByTypes('completed', 'failed') => completed + failed count Queue#getJobCountByTypes('completed', 'waiting', 'failed') => completed + waiting + failed count
Returns the job counts for each type specified or every list/set in the queue by default.
An object, key (type) and value (count)
Returns the logs for a given Job.
the id of the job to get the logs for.
zero based index from where to start returning jobs.
zero based index where to stop returning jobs.
if true, the jobs will be returned in ascending order.
Get current job state.
job identifier.
Returns one of these values: 'completed', 'failed', 'delayed', 'active', 'waiting', 'waiting-children', 'unknown'.
Get queue metrics related to the queue.
This method returns the gathered metrics for the queue. The metrics are represented as an array of job counts per unit of time (1 minute).
Start point of the metrics, where 0 is the newest point to be returned.
End point of the metrics, where -1 is the oldest point to be returned.
Returns the jobs that are in the "prioritized" status.
zero based index from where to start returning jobs.
zero based index where to stop returning jobs.
Returns the number of jobs in prioritized status.
Returns the time to live for a rate limited key in milliseconds.
Optional
maxJobs: numbermax jobs to be considered in rate limit state. If not passed it will return the remaining ttl without considering if max jobs is excedeed.
-2 if the key does not exist. -1 if the key exists but has no associated expire.
Returns the jobs that are in the "waiting" status.
zero based index from where to start returning jobs.
zero based index where to stop returning jobs.
Returns the jobs that are in the "waiting-children" status. I.E. parent jobs that have at least one child that has not completed yet.
zero based index from where to start returning jobs.
zero based index where to stop returning jobs.
Returns the number of jobs in waiting-children status.
Returns the number of jobs in waiting or paused statuses.
Get the worker list related to the queue. i.e. all the known workers that are available to process jobs for this queue. Note: GCP does not support SETNAME, so this call will not work
Returns the current count of workers for the queue.
getWorkersCount(): Promise
Wraps the code with telemetry and provides a span for configuration.
kind of the span: Producer, Consumer, Internal
operation name (such as add, process, etc)
destination name (normally the queue name)
code to wrap with telemetry
Optional
srcPropagationMetadata: string
Provides different getters for different aspects of a queue.