Skip to content

Graphorin API reference v0.1.0


Graphorin API reference / @graphorin/workflow / checkpoint-store-memory / InMemoryCheckpointStore

Class: InMemoryCheckpointStore

Defined in: packages/workflow/src/checkpoint-store-memory.ts:33

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

ts
new InMemoryCheckpointStore(): InMemoryCheckpointStore;

Returns

InMemoryCheckpointStore

Methods

deleteThread()

ts
deleteThread(threadId): Promise<void>;

Defined in: packages/workflow/src/checkpoint-store-memory.ts:141

Parameters

ParameterType
threadIdstring

Returns

Promise&lt;void&gt;

Implementation of

CheckpointStore.deleteThread


getTuple()

ts
getTuple(
   threadId, 
   namespace, 
   checkpointId?): Promise<
  | CheckpointTuple
| null>;

Defined in: packages/workflow/src/checkpoint-store-memory.ts:81

Parameters

ParameterType
threadIdstring
namespacestring
checkpointId?string

Returns

Promise< | CheckpointTuple | null>

Implementation of

CheckpointStore.getTuple


list()

ts
list(
   threadId, 
   namespace, 
opts?): AsyncIterable<CheckpointTuple>;

Defined in: packages/workflow/src/checkpoint-store-memory.ts:105

Parameters

ParameterType
threadIdstring
namespacestring
opts?ListOptions

Returns

AsyncIterable&lt;CheckpointTuple&gt;

Implementation of

CheckpointStore.list


put()

ts
put(
   threadId, 
   namespace, 
   checkpoint, 
metadata): Promise<string>;

Defined in: packages/workflow/src/checkpoint-store-memory.ts:37

Parameters

ParameterType
threadIdstring
namespacestring
checkpointCheckpoint
metadataCheckpointMetadata

Returns

Promise&lt;string&gt;

Implementation of

CheckpointStore.put


putWrites()

ts
putWrites(
   threadId, 
   namespace, 
   checkpointId, 
   writes, 
taskId): Promise<void>;

Defined in: packages/workflow/src/checkpoint-store-memory.ts:59

Parameters

ParameterType
threadIdstring
namespacestring
checkpointIdstring
writesreadonly PendingWrite[]
taskIdstring

Returns

Promise&lt;void&gt;

Implementation of

CheckpointStore.putWrites


size()

ts
size(): number;

Defined in: packages/workflow/src/checkpoint-store-memory.ts:159

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