Table of Contents

Interface IProjectionGenerationStore

Namespace
Excalibur.EventSourcing.Subscriptions
Assembly
Excalibur.EventSourcing.dll

Stores reader routing in the same atomic boundary as subscription member lifetimes.

public interface IProjectionGenerationStore

Remarks

Writers remain pinned to their configured destination. A referenced binding cannot be retired. Physical destination deletion and draining in-flight readers are separate lifecycle operations.

Methods

ReadGenerationAsync(string, string, CancellationToken)

Reads the active pointer and referenced member in one consistent snapshot.

Task<ProjectionGeneration?> ReadGenerationAsync(string subscriptionName, string readerName, CancellationToken cancellationToken)

Parameters

subscriptionName string

The stable subscription name.

readerName string

The stable reader name.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<ProjectionGeneration>

The active generation, or null when no pointer exists.

TryRemoveGenerationAsync(string, string, Guid, CancellationToken)

Decommissions a reader pointer if its revision still matches.

Task<bool> TryRemoveGenerationAsync(string subscriptionName, string readerName, Guid expectedRevision, CancellationToken cancellationToken)

Parameters

subscriptionName string

The stable subscription name.

readerName string

The reader being decommissioned.

expectedRevision Guid

The exact observed pointer revision.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<bool>

True when removed; false when absent, superseded, or not applied because of a database concurrency conflict.

Remarks

Stop users of this reader before removal. This does not delete a destination or drain in-flight reads.

TrySetGenerationAsync(string, string, Guid?, string, Guid, long, CancellationToken)

Atomically installs a pointer only if its revision and the target lifetime's progress match.

Task<bool> TrySetGenerationAsync(string subscriptionName, string readerName, Guid? expectedRevision, string projectionKey, Guid bindingId, long minimumPosition, CancellationToken cancellationToken)

Parameters

subscriptionName string

The stable subscription name.

readerName string

The stable reader name.

expectedRevision Guid?

The observed pointer revision; null requires an absent pointer.

projectionKey string

The target member key.

bindingId Guid

The exact target lifetime.

minimumPosition long

The minimum required contiguous checkpoint; an absent checkpoint never qualifies.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<bool>

True if installed; false if not applied because a precondition did not match or a database concurrency conflict rolled back the mutation.

Remarks

Each successful transition receives a new revision, including rollback. A connection failure can leave the outcome unknown: reread authoritative state before retrying. A successful switch does not drain readers.