Class ProjectionGenerationControl<TProjection>
- Namespace
- Excalibur.EventSourcing.Projections
- Assembly
- Excalibur.EventSourcing.dll
Manages the generation pointer paired with a registered projection reader.
public sealed class ProjectionGenerationControl<TProjection> where TProjection : class
Type Parameters
TProjectionThe reader's projection schema.
- Inheritance
-
ProjectionGenerationControl<TProjection>
- Inherited Members
Methods
CutOverAsync(string, Guid?, long, CancellationToken)
Switches this reader using its paired source and the previously observed revision.
public Task<ProjectionGenerationCutoverResult> CutOverAsync(string newProjectionKey, Guid? expectedRevision, long maxAcceptableLag, CancellationToken cancellationToken)
Parameters
newProjectionKeystringThe target generation's durable member key.
expectedRevisionGuid?The observed revision; null requires an absent pointer.
maxAcceptableLaglongThe accepted lag in stream positions.
cancellationTokenCancellationTokenCancellation token.
Returns
- Task<ProjectionGenerationCutoverResult>
The observed cutover outcome and lag.
DecommissionAsync(Guid, CancellationToken)
Removes this reader pointer only if its captured revision still matches.
public Task<bool> DecommissionAsync(Guid expectedRevision, CancellationToken cancellationToken)
Parameters
expectedRevisionGuidThe revision observed before stopping and draining readers.
cancellationTokenCancellationTokenCancellation token.
Returns
ReadGenerationAsync(CancellationToken)
Reads the authoritative pointer revision before a management decision.
public Task<ProjectionGeneration?> ReadGenerationAsync(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenCancellation token.
Returns
- Task<ProjectionGeneration>
The active generation, or null when no pointer exists.