Overview
The QueueGetters class provides various getter methods for retrieving information about jobs, counts, and queue state. The Queue class extends QueueGetters, so all these methods are available on Queue instances.You typically don’t instantiate QueueGetters directly. Use the Queue class which inherits these methods.
Methods
getJob
Fetches a job by its ID.The job ID to fetch
count
Returns the number of jobs waiting to be processed.Total count of waiting, paused, delayed, prioritized, and waiting-children jobs
getJobCounts
Returns the job counts for each type specified.Job types to count (e.g., ‘waiting’, ‘active’, ‘completed’, ‘failed’)
getJobCountByTypes
Returns the total count for specified job types.getCompletedCount
Returns the number of jobs in completed status.getFailedCount
Returns the number of jobs in failed status.getDelayedCount
Returns the number of jobs in delayed status.getActiveCount
Returns the number of jobs in active status.getWaitingCount
Returns the number of jobs in waiting or paused status.getWaitingChildrenCount
Returns the number of jobs in waiting-children status.getPrioritizedCount
Returns the number of jobs in prioritized status.getCountsPerPriority
Returns the number of jobs per priority level.Array of priority values to check
getJobs
Returns jobs on the given statuses.Job statuses to retrieve
Zero-based index from where to start
Zero-based index where to stop
If true, return in ascending order
getWaiting
Returns jobs in waiting status.getWaitingChildren
Returns jobs in waiting-children status.getActive
Returns jobs in active status.getDelayed
Returns jobs in delayed status.getPrioritized
Returns jobs in prioritized status.getCompleted
Returns jobs in completed status.getFailed
Returns jobs in failed status.getJobLogs
Returns the logs for a given job.The job ID to get logs for
Start index
End index
Return in ascending order
getJobState
Gets the current state of a job.One of: ‘completed’, ‘failed’, ‘delayed’, ‘active’, ‘waiting’, ‘waiting-children’, ‘unknown’
getDependencies
Returns the dependencies of a parent job.getMeta
Returns the global queue configuration.getGlobalConcurrency
Gets the global concurrency value.getGlobalRateLimit
Gets the global rate limit values.getRateLimitTtl
Returns the time to live for a rate limited key.-2 if key does not exist, -1 if key exists but has no expire, otherwise TTL in milliseconds
getDeduplicationJobId
Gets the job ID from deduplicated state.Deduplication identifier
getWorkers
Gets the worker list related to the queue.getWorkersCount
Returns the current count of workers for the queue.getMetrics
Gets queue metrics.Metric type: ‘completed’ or ‘failed’
Start point (0 is newest)
End point (-1 is oldest)
exportPrometheusMetrics
Exports metrics in Prometheus format.Additional labels to include in metrics
JobType
Valid job types/states:'active'- Currently being processed'waiting'- Waiting to be processed'completed'- Successfully completed'failed'- Failed after all attempts'delayed'- Scheduled for future processing'paused'- In a paused queue'prioritized'- Waiting with priority'waiting-children'- Waiting for child jobs to complete
