ObjectStorageSnapshotStore
Defined in: src/persistence/snapshot-stores/ObjectStorageSnapshotStore.ts:49
SnapshotStore backed by any ObjectStorageBackend. Each snapshot
lands at <prefix><pid>/<seq.padStart(20,'0')>.json — the padding
scheme is what makes loadLatest cheap (single LIST with limit:1
and reverse iteration over the sorted result).
keepN-based pruning runs after every successful save; older
snapshots are deleted in a best-effort post-pass. A failed prune
does not fail the save — the next save retries.
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ObjectStorageSnapshotStore(
opts):ObjectStorageSnapshotStore
Defined in: src/persistence/snapshot-stores/ObjectStorageSnapshotStore.ts:56
Parameters
Section titled “Parameters”ObjectStorageSnapshotStoreOptions
Returns
Section titled “Returns”ObjectStorageSnapshotStore
Methods
Section titled “Methods”close()
Section titled “close()”close():
Promise<void>
Defined in: src/persistence/snapshot-stores/ObjectStorageSnapshotStore.ts:154
Best-effort teardown.
Returns
Section titled “Returns”Promise<void>
Implementation of
Section titled “Implementation of”delete()
Section titled “delete()”delete(
pid,toSeq):Promise<void>
Defined in: src/persistence/snapshot-stores/ObjectStorageSnapshotStore.ts:146
Delete snapshots up to and including toSeq. Useful for pruning.
Parameters
Section titled “Parameters”string
number
Returns
Section titled “Returns”Promise<void>
Implementation of
Section titled “Implementation of”loadBefore()
Section titled “loadBefore()”loadBefore<
S>(pid,seq,options?):Promise<Option<Snapshot<S>>>
Defined in: src/persistence/snapshot-stores/ObjectStorageSnapshotStore.ts:133
Load the newest snapshot with sequenceNr < seq, or None.
Type Parameters
Section titled “Type Parameters”S
Parameters
Section titled “Parameters”string
number
options?
Section titled “options?”PersistenceOptions
Returns
Section titled “Returns”Implementation of
Section titled “Implementation of”loadLatest()
Section titled “loadLatest()”Defined in: src/persistence/snapshot-stores/ObjectStorageSnapshotStore.ts:125
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
Parameters
Section titled “Parameters”string
options?
Section titled “options?”PersistenceOptions
Returns
Section titled “Returns”Implementation of
Section titled “Implementation of”save()
Section titled “save()”save<
S>(pid,seq,state,options?):Promise<Snapshot<S>>
Defined in: src/persistence/snapshot-stores/ObjectStorageSnapshotStore.ts:64
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
Parameters
Section titled “Parameters”string
number
S
options?
Section titled “options?”PersistenceOptions
Returns
Section titled “Returns”Promise<Snapshot<S>>