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 TypeMethodDescriptionvoid
asyncCommit
(org.infinispan.commons.util.concurrent.AggregateCompletionStage<Void> stage, Consumer<DatabaseUpdate> databaseUpdates) Asynchronously commits the transaction.void
asyncRollback
(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)
CompletionStage
into thestage
.Any blocking operation should be consumed by the
databaseUpdates
. It will be executed at a later instant.- Parameters:
stage
- TheAggregateCompletionStage
to collect theCompletionStage
.databaseUpdates
- TheConsumer
to use for blocking/database updates.
-
asyncRollback
Asynchronously rollbacks the transaction.The implementation should not block the thread and add any (or none)
CompletionStage
into thestage
.- Parameters:
stage
- TheAggregateCompletionStage
to collect theCompletionStage
.
-