Skip to content

Passive Projections

Mark a projection as passive (not actively observing) using [Passive]:

using Cratis.Chronicle.Events;
using Cratis.Chronicle.Keys;
using Cratis.Chronicle.Projections.ModelBound;
using Cratis.Chronicle.ReadModels;
[EventType]
public record MbPassiveSnapshotCreated(string Data);
[Passive]
public record MbPassiveHistoricalSnapshot(
[Key]
Guid Id,
[SetFrom<MbPassiveSnapshotCreated>(nameof(MbPassiveSnapshotCreated.Data))]
string Data);
  • On-demand projections that are only rebuilt when explicitly requested
  • Historical snapshots
  • Resource-intensive projections that shouldn’t run continuously
  • Use for expensive projections that are only needed occasionally
  • Consider the trade-off between resource usage and data freshness
  • Ensure you have mechanisms to trigger rebuilds when needed