A package that provides a composable IDispatcher<ResolvedEvent> that can be used to conditionally snapshot the current state of the system.
Included:
ISnapshotStrategy- an interface that can be implemented to define when a snapshot should be recorded by the dispatcherIntervalSnapshotStrategy,OnceDailySnapshotStrategy, andNamedEventSnapshotStrategyare provided as ready made implementations
IStateProvider- an interface that should be implemented by a class that provides the current state that should be persisted when a snapshot is recordedIStateSnapshotter- an interface that can be implemented to define how to save and load snapshotsProtoBufStateSnapshotterandJsonSerialisingFileStateSnapshotterare provided as ready made implementations
SnapshottingResolvedEventDispatcher- a dispatcher that is composable from the above, which dispatchesResolvedEvents to an inner dispatcher and conditionally triggers a snapshot of the current state to be recorded