EventStore
interface EventStore
Interface for storing and retrieving domain event streams. Provides methods to append events and load event streams by aggregate ID and version/time ranges.
Author
ahoo wang
Inheritors
Functions
Link copied to clipboard
Appends a domain event stream to the event store. Ensures transaction consistency and handles version conflicts.
Link copied to clipboard
abstract fun load(aggregateId: AggregateId, headVersion: Int = DEFAULT_HEAD_VERSION, tailVersion: Int = DEFAULT_TAIL_VERSION): Flux<DomainEventStream>
Loads domain event streams for the specified aggregate within the given version range. The range is inclusive: headVersion, tailVersion.
abstract fun load(aggregateId: AggregateId, headEventTime: Long, tailEventTime: Long): Flux<DomainEventStream>
Loads domain event streams for the specified aggregate within the given event time range. The range is inclusive: headEventTime, tailEventTime.
Link copied to clipboard
Wraps an EventStore with metrics collection capabilities. Returns a MetricEventStore that collects metrics on event storage operations.