Interface IGlobalStreamProjection<TState>
- Namespace
- Excalibur.EventSourcing.Projections
- Assembly
- Excalibur.EventSourcing.dll
Defines a projection that processes events from the global event stream across all aggregates and types.
public interface IGlobalStreamProjection<TState> where TState : class
Type Parameters
TStateThe projection state type.
Remarks
Global stream projections differ from per-aggregate projections in that they receive events from all streams. This enables cross-aggregate views such as dashboards, reporting, and analytics.
Implement this interface and register it with a GlobalStreamProjectionHost<TState> to process events continuously.
Methods
ApplyAsync(IDomainEvent, TState, CancellationToken)
Applies a domain event to the projection state.
Task ApplyAsync(IDomainEvent domainEvent, TState state, CancellationToken cancellationToken)
Parameters
domainEventIDomainEventThe domain event to apply.
stateTStateThe current projection state.
cancellationTokenCancellationTokenCancellation token.
Returns
- Task
A task representing the asynchronous operation.