Skip to main content

JobBufferStorageStrategy

This strategy defines where to store jobs that have been collected by a JobBuffer.

Info

This is configured via the jobQueueOptions.jobBufferStorageStrategy property of your VendureConfig.

Signature

add

method(bufferId: string, job: Job) => Promise<Job>

Persist a job to the storage medium. The storage format should take into account the bufferId argument, as it is necessary to be able to later retrieve jobs by that id.

bufferSize

method(bufferIds?: string[]) => Promise<{ [bufferId: string]: number }>

Returns an object containing the number of buffered jobs arranged by bufferId.

Passing bufferIds limits the results to the specified bufferIds. If the array is empty, sizes will be returned for all bufferIds.

Example

Ts

flush

method(bufferIds?: string[]) => Promise<{ [bufferId: string]: Job[] }>

Clears all jobs from the storage medium which match the specified bufferIds (if the array is empty, clear for all bufferIds), and returns those jobs in an object arranged by bufferId

Example

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