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
projectionNamestringName of the projection
cancellationTokenCancellationTokenCancellation token
Returns
GetRegisteredProjections()
Gets all registered projection names
IReadOnlyList<string> GetRegisteredProjections()
Returns
RegisterProjection<TState>(IProjectionDefinition<TState>)
Registers a projection definition
void RegisterProjection<TState>(IProjectionDefinition<TState> definition) where TState : class
Parameters
definitionIProjectionDefinition<TState>The projection definition
Type Parameters
TStateThe projection state type
SaveCheckpointAsync(string, long, CancellationToken)
Saves the checkpoint for a projection
Task SaveCheckpointAsync(string projectionName, long position, CancellationToken cancellationToken = default)
Parameters
projectionNamestringName of the projection
positionlongLast processed event position
cancellationTokenCancellationTokenCancellation token
Returns
UpdateAsync(SequencedEvent[], CancellationToken)
Applies new events to all registered projections
Task UpdateAsync(SequencedEvent[] events, CancellationToken cancellationToken = default)
Parameters
eventsSequencedEvent[]Events to apply
cancellationTokenCancellationTokenCancellation token