Skip to content

Graphorin API reference v0.7.0


Graphorin API reference / @graphorin/workflow / / CheckpointStore

Interface: CheckpointStore

Defined in: packages/core/dist/contracts/checkpoint-store.d.ts

Pluggable checkpoint storage interface. The default implementation lives in @graphorin/store-sqlite.

Stable

Methods

deleteThread()

ts
deleteThread(threadId): Promise<void>;

Defined in: packages/core/dist/contracts/checkpoint-store.d.ts

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

ParameterType
threadIdstring

Returns

Promise&lt;void&gt;


getTuple()

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

Defined in: packages/core/dist/contracts/checkpoint-store.d.ts

Parameters

ParameterType
threadIdstring
namespacestring
checkpointId?string

Returns

Promise< | CheckpointTuple | null>


list()

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

Defined in: packages/core/dist/contracts/checkpoint-store.d.ts

Parameters

ParameterType
threadIdstring
namespacestring
opts?ListOptions

Returns

AsyncIterable&lt;CheckpointTuple&gt;


listSuspended()?

ts
optional listSuspended(namespace, opts?): Promise<readonly {
  threadId: string;
  wakeAt: number;
}[]>;

Defined in: packages/core/dist/contracts/checkpoint-store.d.ts

W-032: enumerate threads whose LATEST checkpoint in namespace is suspended with a due wakeAt (<= opts.dueBefore, default: any stamped wakeAt). This is what a durable-timer driver polls - without it an operator would have to keep an external registry of sleeping threadIds. OPTIONAL so third-party stores compile unchanged; createTimerDriver throws a typed error when the store lacks it (deterministic policy, no silent no-op).

Parameters

ParameterType
namespacestring
opts?{ dueBefore?: number; limit?: number; }
opts.dueBefore?number
opts.limit?number

Returns

Promise<readonly { threadId: string; wakeAt: number; }[]>


put()

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

Defined in: packages/core/dist/contracts/checkpoint-store.d.ts

Parameters

ParameterType
threadIdstring
namespacestring
checkpointCheckpoint
metadataCheckpointMetadata
opts?CheckpointPutOptions

Returns

Promise&lt;string&gt;


putWrites()

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

Defined in: packages/core/dist/contracts/checkpoint-store.d.ts

Parameters

ParameterType
threadIdstring
namespacestring
checkpointIdstring
writesreadonly PendingWrite[]
taskIdstring

Returns

Promise&lt;void&gt;