Handles events with optimistic locking and event deduplication.
MaterializedLockingDeduplicationView combines ViewStateComputation and ViewStateLockingDeduplicationRepository.
S: materialized-view state typeE: event typeEV: event version typeSV: state version typeM: metadata type
- Implemented types
-
- ViewStateComputation<
S, E> - ViewStateLockingDeduplicationRepository<
E, S, EV, SV, M>
- ViewStateComputation<
Properties
-
evolve
→ Evolve<
S, E> -
Applies an event to a state and returns the next state.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- initialState → S
-
State used before any events have been applied.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
computeNewState(
S? state, E event) → S -
Computes new state based on the event.
inherited
-
fetchState(
E event) → Future< (S?, SV?)> -
Returns the current state affected by
eventand its state version.inherited -
fetchStateWithMetadata(
E event) → Future< (S?, SV?, M)> -
Returns the current state, state version, and metadata for
event.inherited -
handleOptimisticallyWithDeduplication(
(E, EV) eventAndVersion) → Future< (S, SV)> -
Handles
eventAndVersionwith optimistic locking and event deduplication. -
handleOptimisticallyWithDeduplicationAndMetadata(
(E, EV) eventAndVersion, M metadata) → Future< (S, SV, M)> -
Handles
eventAndVersionwithmetadata, optimistic locking, and event deduplication. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
save(
S state, EV eventVersion, SV? currentStateVersion) → Future< (S, SV)> -
Persists
stateif the state and event versions are acceptable.inherited -
saveWithMetadata(
S state, EV eventVersion, SV? currentStateVersion, M metadata) → Future< (S, SV, M)> -
Persists
statewithmetadatawhen versions are acceptable.inherited -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited