---
title: "InMemoryJobBufferStorageStrategy"
generated: true
---
<GenerationInfo sourceFile="packages/core/src/job-queue/job-buffer/in-memory-job-buffer-storage-strategy.ts" sourceLine="17" packageName="@vendure/core" since="1.3.0" />

A <DocsLink href="/reference/typescript-api/job-queue/job-buffer-storage-strategy#jobbufferstoragestrategy">JobBufferStorageStrategy</DocsLink> 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 <DocsLink href="/reference/typescript-api/job-queue/default-job-queue-plugin#defaultjobqueueplugin">DefaultJobQueuePlugin</DocsLink> with the `useDatabaseForBuffer: true` option set,
or the <DocsLink href="/reference/core-plugins/job-queue-plugin/bull-mqjob-queue-plugin#bullmqjobqueueplugin">BullMQJobQueuePlugin</DocsLink> or another custom strategy with persistent storage.

```ts title="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: <DocsLink href="/reference/typescript-api/job-queue/job-buffer-storage-strategy#jobbufferstoragestrategy">`JobBufferStorageStrategy`</DocsLink>



<div className="members-wrapper">

### bufferStorage

<MemberInfo kind="property" type={``}   />


### add

<MemberInfo kind="method" type={`(bufferId: string, job: <a href='/reference/typescript-api/job-queue/job#job'>Job</a>) => Promise<<a href='/reference/typescript-api/job-queue/job#job'>Job</a>>`}   />


### bufferSize

<MemberInfo kind="method" type={`(bufferIds?: string[]) => Promise<{ [bufferId: string]: number }>`}   />


### flush

<MemberInfo kind="method" type={`(bufferIds?: string[]) => Promise<{ [bufferId: string]: <a href='/reference/typescript-api/job-queue/job#job'>Job</a>[] }>`}   />




</div>
