SnapshotStore
Defined in: src/persistence/SnapshotStore.ts:10
Pluggable snapshot store. Snapshots short-circuit recovery by fast- forwarding the state machine to a known point, so replay only needs to apply events newer than the snapshot.
Methods
Section titled “Methods”close()?
Section titled “close()?”
optionalclose():Promise<void>
Defined in: src/persistence/SnapshotStore.ts:39
Best-effort teardown.
Returns
Section titled “Returns”Promise<void>
delete()
Section titled “delete()”delete(
pid,toSeq):Promise<void>
Defined in: src/persistence/SnapshotStore.ts:36
Delete snapshots up to and including toSeq. Useful for pruning.
Parameters
Section titled “Parameters”string
number
Returns
Section titled “Returns”Promise<void>
loadBefore()
Section titled “loadBefore()”loadBefore<
S>(pid,seq,options?):Promise<Option<Snapshot<S>>>
Defined in: src/persistence/SnapshotStore.ts:33
Load the newest snapshot with sequenceNr < seq, or None.
Type Parameters
Section titled “Type Parameters”S = unknown
Parameters
Section titled “Parameters”string
number
options?
Section titled “options?”PersistenceOptions
Returns
Section titled “Returns”loadLatest()
Section titled “loadLatest()”Defined in: src/persistence/SnapshotStore.ts:30
Load the newest snapshot for pid, or None if none exist.
options.encryption is required when client-side encryption was
used at write time — the store has no other way to obtain the
master key. Stores that don’t encrypt ignore the field.
Type Parameters
Section titled “Type Parameters”S = unknown
Parameters
Section titled “Parameters”string
options?
Section titled “options?”PersistenceOptions
Returns
Section titled “Returns”save()
Section titled “save()”save<
S>(pid,seq,state,options?):Promise<Snapshot<S>>
Defined in: src/persistence/SnapshotStore.ts:17
Persist a snapshot at seq — typically the seq of the latest event
applied. Optional options carry per-call preferences from the
caller (e.g. compression/encryption set on the actor). Stores that
cannot honour them silently ignore the field.
Type Parameters
Section titled “Type Parameters”S = unknown
Parameters
Section titled “Parameters”string
number
S
options?
Section titled “options?”PersistenceOptions
Returns
Section titled “Returns”Promise<Snapshot<S>>