Table of Contents

Interface IProjectionManager

Namespace
Opossum.Projections
Assembly
Opossum.dll

Manages projection lifecycle, registration, and updates

public interface IProjectionManager

Methods

GetCheckpointAsync(string, CancellationToken)

Gets the last processed event position for a projection

Task<long> GetCheckpointAsync(string projectionName, CancellationToken cancellationToken = default)

Parameters

projectionName string

Name of the projection

cancellationToken CancellationToken

Cancellation token

Returns

Task<long>

Last processed position, or 0 if never processed

GetRegisteredProjections()

Gets all registered projection names

IReadOnlyList<string> GetRegisteredProjections()

Returns

IReadOnlyList<string>

RegisterProjection<TState>(IProjectionDefinition<TState>)

Registers a projection definition

void RegisterProjection<TState>(IProjectionDefinition<TState> definition) where TState : class

Parameters

definition IProjectionDefinition<TState>

The projection definition

Type Parameters

TState

The projection state type

SaveCheckpointAsync(string, long, CancellationToken)

Saves the checkpoint for a projection

Task SaveCheckpointAsync(string projectionName, long position, CancellationToken cancellationToken = default)

Parameters

projectionName string

Name of the projection

position long

Last processed event position

cancellationToken CancellationToken

Cancellation token

Returns

Task

UpdateAsync(SequencedEvent[], CancellationToken)

Applies new events to all registered projections

Task UpdateAsync(SequencedEvent[] events, CancellationToken cancellationToken = default)

Parameters

events SequencedEvent[]

Events to apply

cancellationToken CancellationToken

Cancellation token

Returns

Task