Skip to main content

InMemoryJobQueueStrategy

An in-memory JobQueueStrategy. This is the default strategy if not using a dedicated JobQueue plugin (e.g. DefaultJobQueuePlugin). Not recommended for production, since the queue will be cleared when the server stops, and can only be used when the JobQueueService is started from the main server process:

Example

Ts

Attempting to use this strategy when running the worker in a separate process (using bootstrapWorker()) will result in an error on startup.

Completed jobs will be evicted from the store every 2 hours to prevent a memory leak.

Signature

jobs

property

unsettledJobs

property{ [queueName: string]: Array<{ job: Job; updatedAt: Date }> }

init

method(injector: Injector) =>

destroy

method() =>

add

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

findOne

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

findMany

method(options?: JobListOptions) => Promise<PaginatedList<Job>>

findManyById

method(ids: ID[]) => Promise<Job[]>

next

method(queueName: string, waitingJobs: Job[] = []) => Promise<Job | undefined>

update

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

removeSettledJobs

method(queueNames: string[] = [], olderThan?: Date) => Promise<number>
Was this chapter helpful?
Report Issue
Edited Feb 25, 2026ยทEdit this page