Class CompositeSnapshotStrategyBuilder
- Namespace
- Excalibur.EventSourcing.DependencyInjection
- Assembly
- Excalibur.EventSourcing.dll
Builder for creating composite snapshot strategies.
public sealed class CompositeSnapshotStrategyBuilder
- Inheritance
-
CompositeSnapshotStrategyBuilder
- Inherited Members
Methods
AddIntervalStrategy(int)
Adds an interval-based snapshot strategy.
public CompositeSnapshotStrategyBuilder AddIntervalStrategy(int eventInterval = 100)
Parameters
eventIntervalintThe number of events between snapshots. Default: 100.
Returns
- CompositeSnapshotStrategyBuilder
The builder for fluent configuration.
AddSizeBasedStrategy(long)
Adds a size-based snapshot strategy.
public CompositeSnapshotStrategyBuilder AddSizeBasedStrategy(long maxSizeInBytes)
Parameters
maxSizeInByteslongThe maximum size in bytes before creating a snapshot.
Returns
- CompositeSnapshotStrategyBuilder
The builder for fluent configuration.
AddTimeBasedStrategy(TimeSpan)
Adds a time-based snapshot strategy.
public CompositeSnapshotStrategyBuilder AddTimeBasedStrategy(TimeSpan timeInterval)
Parameters
timeIntervalTimeSpanThe time interval between snapshots.
Returns
- CompositeSnapshotStrategyBuilder
The builder for fluent configuration.
Build()
Builds the composite snapshot strategy.
public ISnapshotStrategy Build()
Returns
- ISnapshotStrategy
The configured composite snapshot strategy.
RequireAll(bool)
Sets whether all strategies must agree to create a snapshot.
public CompositeSnapshotStrategyBuilder RequireAll(bool requireAll = true)
Parameters
requireAllboolTrue if all strategies must agree; otherwise, any strategy triggers snapshot.
Returns
- CompositeSnapshotStrategyBuilder
The builder for fluent configuration.