🚨 Announcing Vendure v2 Beta

InMemoryJobBufferStorageStrategy

InMemoryJobBufferStorageStrategy

A JobBufferStorageStrategy which keeps the buffered jobs in memory. Should not be used in production, since it will lose data in the event of the server stopping.

Instead, use the DefaultJobQueuePlugin with the useDatabaseForBuffer: true option set, or the BullMQJobQueuePlugin or another custom strategy with persistent storage.

Signature

class InMemoryJobBufferStorageStrategy implements JobBufferStorageStrategy {
  protected protected bufferStorage = new Map<string, Set<Job>>();
  async add(bufferId: string, job: Job) => Promise<Job>;
  async bufferSize(bufferIds?: string[]) => Promise<{ [bufferId: string]: number }>;
  async flush(bufferIds?: string[]) => Promise<{ [bufferId: string]: Job[] }>;
}

Implements

Members

bufferStorage

protected property
type:

add

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

bufferSize

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

flush

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