Skip to content

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.

optional close(): Promise<void>

Defined in: src/persistence/SnapshotStore.ts:39

Best-effort teardown.

Promise<void>


delete(pid, toSeq): Promise<void>

Defined in: src/persistence/SnapshotStore.ts:36

Delete snapshots up to and including toSeq. Useful for pruning.

string

number

Promise<void>


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.

S = unknown

string

number

PersistenceOptions

Promise<Option<Snapshot<S>>>


loadLatest<S>(pid, options?): Promise<Option<Snapshot<S>>>

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.

S = unknown

string

PersistenceOptions

Promise<Option<Snapshot<S>>>


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.

S = unknown

string

number

S

PersistenceOptions

Promise<Snapshot<S>>