Interface NonBlockingTransaction
- All Known Implementing Classes:
AuthenticationSessionChangeLogTransaction,ClientSessionChangeLogTransaction,ClientSessionPersistentChangelogBasedTransaction,InfinispanChangelogBasedTransaction,InfinispanKeycloakTransaction,LoginFailureChangeLogTransaction,PersistentSessionsChangelogBasedTransaction,RemoteChangeLogTransaction,SingleUseObjectTransaction,UserSessionChangeLogTransaction,UserSessionPersistentChangelogBasedTransaction,UserSessionTransaction
public interface NonBlockingTransaction
Represents a non-blocking transaction.
The commit and rollback operations should not block the invoker thread and register any CompletionStage into
the AggregateCompletionStage. The invoker is responsible to provide the AggregateCompletionStage and
to wait for its completion.
-
Method Summary
Modifier and TypeMethodDescriptionvoidasyncCommit(org.infinispan.commons.util.concurrent.AggregateCompletionStage<Void> stage, Consumer<DatabaseUpdate> databaseUpdates) Asynchronously commits the transaction.voidasyncRollback(org.infinispan.commons.util.concurrent.AggregateCompletionStage<Void> stage) Asynchronously rollbacks the transaction.
-
Method Details
-
asyncCommit
void asyncCommit(org.infinispan.commons.util.concurrent.AggregateCompletionStage<Void> stage, Consumer<DatabaseUpdate> databaseUpdates) Asynchronously commits the transaction.The implementation should not block the thread and add any (or none)
CompletionStageinto thestage.Any blocking operation should be consumed by the
databaseUpdates. It will be executed at a later instant.- Parameters:
stage- TheAggregateCompletionStageto collect theCompletionStage.databaseUpdates- TheConsumerto use for blocking/database updates.
-
asyncRollback
Asynchronously rollbacks the transaction.The implementation should not block the thread and add any (or none)
CompletionStageinto thestage.- Parameters:
stage- TheAggregateCompletionStageto collect theCompletionStage.
-