EventLockingRepository<C, E, V, CM, EM> class abstract interface

Stores and retrieves event streams with optimistic locking.

If you fetch an event from storage, the application records the version number of that event. You can save new events only if the version number in storage has not changed. If there is a version mismatch, it means that someone else has added another event before you did.

  • C: command type
  • E: event type
  • V: version type
  • CM: command metadata type
  • EM: event metadata type
Implementers

Properties

hashCode int
The hash code for this object.
no setterinherited
latestVersionProvider LatestVersionProvider<E, V>
The latest event stream version provider.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

fetchEvents(C command) Stream<(E, V)>
Returns the event stream associated with command, paired with versions.
fetchEventsWithMetadata(C command) Stream<(E, V, EM)>
Returns the event stream associated with command, paired with versions and metadata.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
save(Stream<E> events, LatestVersionProvider<E, V> latestVersionProvider) Stream<(E, V)>
Persists events using latestVersionProvider and returns the newly saved event stream paired with versions.
saveAtVersion(Stream<E> events, V? latestVersion) Stream<(E, V)>
Persists events using the explicit latestVersion and returns the newly saved event stream paired with versions.
saveAtVersionWithMetadata(Stream<E> events, V? latestVersion, CM metadata) Stream<(E, V, EM)>
Persists events using the explicit latestVersion and returns the newly saved event stream paired with versions and metadata.
saveWithMetadata(Stream<E> events, LatestVersionProvider<E, V> latestVersionProvider, CM metadata) Stream<(E, V, EM)>
Persists events using latestVersionProvider and returns the newly saved event stream paired with versions and metadata.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited