Interface IProjectionCheckpointStore
- Namespace
- Stratara.Abstractions.Projections
- Assembly
- Stratara.Abstractions.dll
Reads and writes the position a store-reading consumer resumes after, one per consumer and partition. A position is only meaningful to the reader that produced it, so every read names the reader it expects and a checkpoint written under another reader is refused rather than misread.
public interface IProjectionCheckpointStore
- Extension Methods
Methods
GetAsync(string, int, string, CancellationToken)
Returns the stored position, or 0 where none exists.
Task<long> GetAsync(string projection, int partition, string reader, CancellationToken cancellationToken = default)
Parameters
projectionstringThe consumer, by the name the framework gives it.
partitionintThe partition.
readerstringThe name of the reader whose positions are expected.
cancellationTokenCancellationTokenPropagated to the store.
Returns
Exceptions
- InvalidOperationException
A checkpoint exists but was written under a different reader.
SetAsync(string, int, string, long, CancellationToken)
Stores a position, replacing the previous one.
Task SetAsync(string projection, int partition, string reader, long position, CancellationToken cancellationToken = default)
Parameters
projectionstringThe consumer, by the name the framework gives it.
partitionintThe partition.
readerstringThe name of the reader whose position this is.
positionlongThe position to resume after.
cancellationTokenCancellationTokenPropagated to the store.
Returns
- Task
A task that completes when the position is stored.