Skip to main content
Table of Contents

Interface ISnapshotService

Namespace
Stratara.Abstractions.EventSourcing
Assembly
Stratara.Abstractions.dll

Decides whether a stream's accumulated event count warrants writing a new snapshot and writes it when needed. Invoked by IEventSource on save.

public interface ISnapshotService
Extension Methods

Methods

AddSnapshotIfNeededAsync(IEnumerable<EventStreamEntry>, CancellationToken)

Inspect eventStreamEntries grouped by stream; for any stream that has crossed the snapshot threshold, reconstruct + persist a fresh snapshot.

Task AddSnapshotIfNeededAsync(IEnumerable<EventStreamEntry> eventStreamEntries, CancellationToken cancellationToken = default)

Parameters

eventStreamEntries IEnumerable<EventStreamEntry>
cancellationToken CancellationToken

Returns

Task