Skip to main content

PollingJobQueueStrategy

This class allows easier implementation of JobQueueStrategy in a polling style. Instead of providing JobQueueStrategy start() you should provide a next method.

This class should be extended by any strategy which does not support a push-based system to notify on new jobs. It is used by the SqlJobQueueStrategy and InMemoryJobQueueStrategy.

Signature
  • Extends: InjectableJobQueueStrategy

concurrency

propertynumber

pollInterval

propertynumber | ((queueName: string) => number)

setRetries

property(queueName: string, job: Job) => number

backOffStrategy

gracefulShutdownTimeout

propertynumber

activeQueues

property

constructor

method(config?: PollingJobQueueStrategyConfig) => PollingJobQueueStrategy

constructor

method(concurrency?: number, pollInterval?: number) => PollingJobQueueStrategy

constructor

method(concurrencyOrConfig?: number | PollingJobQueueStrategyConfig, maybePollInterval?: number) => PollingJobQueueStrategy

start

method(queueName: string, process: (job: Job<Data>) => Promise<any>) =>

stop

method(queueName: string, process: (job: Job<Data>) => Promise<any>) =>

cancelJob

method(jobId: ID) => Promise<Job | undefined>

next

method(queueName: string) => Promise<Job | undefined>

Should return the next job in the given queue. The implementation is responsible for returning the correct job according to the time of creation.

update

method(job: Job) => Promise<void>

Update the job details in the store.

findOne

method(id: ID) => Promise<Job | undefined>

Returns a job by its id.

Was this chapter helpful?
Report Issue
Edited Feb 25, 2026ยทEdit this page