SnapshotStrategy
Strategy for managing snapshots of state aggregates. Snapshot strategies determine when and how to create snapshots based on state events. This helps optimize aggregate loading by reducing the number of events that need to be replayed.
Implementations can define custom logic for snapshot creation, such as:
Taking snapshots after a certain number of events
Taking snapshots at specific time intervals
Taking snapshots based on aggregate state changes
Author
ahoo wang
Inheritors
Types
Functions
Wraps a SnapshotStrategy with metrics collection capabilities. Returns a MetricSnapshotStrategy that collects metrics on snapshot strategy operations.
Processes a state event exchange to determine if a snapshot should be created. Implementations should analyze the event and potentially trigger snapshot creation.