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 bufferStorage = new Map<string, Set<Job>>();
add(bufferId: string, job: Job) => Promise<Job>;
bufferSize(bufferIds?: string[]) => Promise<{ [bufferId: string]: number }>;
flush(bufferIds?: string[]) => Promise<{ [bufferId: string]: Job[] }>;
}
- Implements:
JobBufferStorageStrategy