Graphorin API reference v0.7.0
Graphorin API reference / @graphorin/workflow / checkpoint-store-memory / InMemoryCheckpointStore
Class: InMemoryCheckpointStore
Defined in: packages/workflow/src/checkpoint-store-memory.ts:36
Pure in-memory CheckpointStore implementation. Thread-safe within a single Node.js event loop because every mutation is synchronous; concurrent runs that share the same instance will see a consistent view.
Stable
Implements
Constructors
Constructor
new InMemoryCheckpointStore(): InMemoryCheckpointStore;Returns
InMemoryCheckpointStore
Methods
compactThread()
compactThread(
threadId,
namespace,
keepLast): Promise<number>;Defined in: packages/workflow/src/checkpoint-store-memory.ts:230
W-009 compaction - keep the keepLast newest checkpoints of one pair.
Parameters
| Parameter | Type |
|---|---|
threadId | string |
namespace | string |
keepLast | number |
Returns
Promise<number>
Implementation of
CheckpointStoreExt.compactThread
deleteThread()
deleteThread(threadId): Promise<void>;Defined in: packages/workflow/src/checkpoint-store-memory.ts:156
Full erasure primitive: delete every checkpoint and pending write of this thread across ALL namespaces. Namespace-blind by contract - retention sweeps must use CheckpointStoreExt.pruneThreads instead, which is namespace-scoped and protects suspended threads.
Parameters
| Parameter | Type |
|---|---|
threadId | string |
Returns
Promise<void>
Implementation of
CheckpointStoreExt.deleteThread
getTuple()
getTuple(
threadId,
namespace,
checkpointId?): Promise<
| CheckpointTuple
| null>;Defined in: packages/workflow/src/checkpoint-store-memory.ts:96
Parameters
| Parameter | Type |
|---|---|
threadId | string |
namespace | string |
checkpointId? | string |
Returns
Promise< | CheckpointTuple | null>
Implementation of
list()
list(
threadId,
namespace,
opts?): AsyncIterable<CheckpointTuple>;Defined in: packages/workflow/src/checkpoint-store-memory.ts:120
Parameters
| Parameter | Type |
|---|---|
threadId | string |
namespace | string |
opts? | ListOptions |
Returns
AsyncIterable<CheckpointTuple>
Implementation of
listSuspended()
listSuspended(namespace, opts?): Promise<readonly {
threadId: string;
wakeAt: number;
}[]>;Defined in: packages/workflow/src/checkpoint-store-memory.ts:173
W-032: enumerate threads whose LATEST checkpoint in namespace is suspended with a due wakeAt - parity with the SQLite adapter.
Parameters
| Parameter | Type |
|---|---|
namespace | string |
opts? | { dueBefore?: number; limit?: number; } |
opts.dueBefore? | number |
opts.limit? | number |
Returns
Promise<readonly { threadId: string; wakeAt: number; }[]>
Implementation of
CheckpointStoreExt.listSuspended
pruneThreads()
pruneThreads(opts): Promise<number>;Defined in: packages/workflow/src/checkpoint-store-memory.ts:201
W-009 retention sweep - parity with the SQLite implementation: namespace-SCOPED (entries key as threadId::namespace), latest checkpoint decides age + status, suspended pairs survive unless onlyTerminal: false.
Parameters
| Parameter | Type |
|---|---|
opts | PruneThreadsOptions |
Returns
Promise<number>
Implementation of
CheckpointStoreExt.pruneThreads
put()
put(
threadId,
namespace,
checkpoint,
metadata,
opts?): Promise<string>;Defined in: packages/workflow/src/checkpoint-store-memory.ts:40
Parameters
| Parameter | Type |
|---|---|
threadId | string |
namespace | string |
checkpoint | Checkpoint |
metadata | CheckpointMetadata |
opts? | CheckpointPutOptions |
Returns
Promise<string>
Implementation of
putWrites()
putWrites(
threadId,
namespace,
checkpointId,
writes,
taskId): Promise<void>;Defined in: packages/workflow/src/checkpoint-store-memory.ts:74
Parameters
| Parameter | Type |
|---|---|
threadId | string |
namespace | string |
checkpointId | string |
writes | readonly PendingWrite[] |
taskId | string |
Returns
Promise<void>
Implementation of
size()
size(): number;Defined in: packages/workflow/src/checkpoint-store-memory.ts:254
Test-only helper that exposes the raw count of stored checkpoints
- handy for assertions like "the runtime wrote exactly N checkpoints across the run".
Returns
number