Table of Contents

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

TProjection

The 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

newProjectionKey string

The target generation's durable member key.

expectedRevision Guid?

The observed revision; null requires an absent pointer.

maxAcceptableLag long

The accepted lag in stream positions.

cancellationToken CancellationToken

Cancellation 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

expectedRevision Guid

The revision observed before stopping and draining readers.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<bool>

True when removed; false when absent or changed. The projection binding and data remain.

ReadGenerationAsync(CancellationToken)

Reads the authoritative pointer revision before a management decision.

public Task<ProjectionGeneration?> ReadGenerationAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

Cancellation token.

Returns

Task<ProjectionGeneration>

The active generation, or null when no pointer exists.