Interface EventStorageEngine.AppendTransaction<R>
- Type Parameters:
R- the type of the commit result
- All Known Implementing Classes:
EmptyAppendTransaction
- Enclosing interface:
EventStorageEngine
public static interface EventStorageEngine.AppendTransaction<R>
Interface representing the transaction of an appendEvents invocation.
Events may only be visible to consumers after the invocation of commit().
-
Method Summary
Modifier and TypeMethodDescriptionafterCommit(R commitResult) Returns aCompletableFutureto calculate the consistency marker.commit()Commit any underlying transactions to make the appended events visible to consumers.voidrollback()Rolls back any events that have been appended, permanently making them unavailable for consumers.
-
Method Details
-
commit
CompletableFuture<R> commit()Commit any underlying transactions to make the appended events visible to consumers.Called during the
COMMITphase.- Returns:
- A
CompletableFutureto complete the commit asynchrously, returning a value for.invalid reference
afterCommit
-
rollback
void rollback()Rolls back any events that have been appended, permanently making them unavailable for consumers. -
afterCommit
Returns aCompletableFutureto calculate the consistency marker. This is called only after the transaction has been committed with the result of.invalid reference
commitCalled during the
AFTER_COMMITphase.- Parameters:
commitResult- The result returned from the commit call.- Returns:
- A
CompletableFuturethat completes with the new consistency marker for the transaction. If the transaction was empty (without events to append) then returned consistency marker is alwaysConsistencyMarker.ORIGIN.
-