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 Type
    Method
    Description
    afterCommit(R commitResult)
    Returns a CompletableFuture to calculate the consistency marker.
    Commit any underlying transactions to make the appended events visible to consumers.
    void
    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 COMMIT phase.

      Returns:
      A CompletableFuture to 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

      CompletableFuture<ConsistencyMarker> afterCommit(R commitResult)
      Returns a CompletableFuture to calculate the consistency marker. This is called only after the transaction has been committed with the result of
      invalid reference
      commit
      .

      Called during the AFTER_COMMIT phase.

      Parameters:
      commitResult - The result returned from the commit call.
      Returns:
      A CompletableFuture that completes with the new consistency marker for the transaction. If the transaction was empty (without events to append) then returned consistency marker is always ConsistencyMarker.ORIGIN.