Skip to content

DurableStateOffsetStore

Defined in: src/persistence/projection/OffsetStore.ts:83

Persists offsets via any DurableStateStore — meaning SQLite, Cassandra, S3, filesystem, all become valid offset stores for free, just by reusing the existing plug-in. Each projection’s offsets land under a single durable-state record per (projection, kind) combination, encoded as plain JSON.

The revision-based optimistic-concurrency on DurableStateStore ensures two concurrent projection instances don’t race their cursor writes — the store rejects any save that doesn’t carry the caller’s expected revision. The ProjectionActor itself is single-instance per projection name (or per (projection, shard) in the cluster-wide variant), so contention is the exception, not the rule.

new DurableStateOffsetStore(store): DurableStateOffsetStore

Defined in: src/persistence/projection/OffsetStore.ts:86

DurableStateStore

DurableStateOffsetStore

clear(projection): Promise<void>

Defined in: src/persistence/projection/OffsetStore.ts:104

Forget every cursor for projectionName. Used by tests + reset tooling.

string

Promise<void>

OffsetStore.clear


loadOffset(projection, tag): Promise<Offset>

Defined in: src/persistence/projection/OffsetStore.ts:96

string

string

Promise<Offset>

OffsetStore.loadOffset


loadSequence(projection, pid): Promise<number>

Defined in: src/persistence/projection/OffsetStore.ts:88

string

string

Promise<number>

OffsetStore.loadSequence


saveOffset(projection, tag, offset): Promise<void>

Defined in: src/persistence/projection/OffsetStore.ts:100

string

string

Offset

Promise<void>

OffsetStore.saveOffset


saveSequence(projection, pid, seqNr): Promise<void>

Defined in: src/persistence/projection/OffsetStore.ts:92

string

string

number

Promise<void>

OffsetStore.saveSequence