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.
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new DurableStateOffsetStore(
store):DurableStateOffsetStore
Defined in: src/persistence/projection/OffsetStore.ts:86
Parameters
Section titled “Parameters”Returns
Section titled “Returns”DurableStateOffsetStore
Methods
Section titled “Methods”clear()
Section titled “clear()”clear(
projection):Promise<void>
Defined in: src/persistence/projection/OffsetStore.ts:104
Forget every cursor for projectionName. Used by tests + reset tooling.
Parameters
Section titled “Parameters”projection
Section titled “projection”string
Returns
Section titled “Returns”Promise<void>
Implementation of
Section titled “Implementation of”loadOffset()
Section titled “loadOffset()”loadOffset(
projection,tag):Promise<Offset>
Defined in: src/persistence/projection/OffsetStore.ts:96
Parameters
Section titled “Parameters”projection
Section titled “projection”string
string
Returns
Section titled “Returns”Promise<Offset>
Implementation of
Section titled “Implementation of”loadSequence()
Section titled “loadSequence()”loadSequence(
projection,pid):Promise<number>
Defined in: src/persistence/projection/OffsetStore.ts:88
Parameters
Section titled “Parameters”projection
Section titled “projection”string
string
Returns
Section titled “Returns”Promise<number>
Implementation of
Section titled “Implementation of”saveOffset()
Section titled “saveOffset()”saveOffset(
projection,tag,offset):Promise<void>
Defined in: src/persistence/projection/OffsetStore.ts:100
Parameters
Section titled “Parameters”projection
Section titled “projection”string
string
offset
Section titled “offset”Returns
Section titled “Returns”Promise<void>
Implementation of
Section titled “Implementation of”saveSequence()
Section titled “saveSequence()”saveSequence(
projection,pid,seqNr):Promise<void>
Defined in: src/persistence/projection/OffsetStore.ts:92
Parameters
Section titled “Parameters”projection
Section titled “projection”string
string
number
Returns
Section titled “Returns”Promise<void>