Package io.micronaut.transaction.async
Class AsyncUsingSyncTransactionOperations<C>
- java.lang.Object
-
- io.micronaut.transaction.async.AsyncUsingSyncTransactionOperations<C>
-
- Type Parameters:
C
- The connection type
- All Implemented Interfaces:
AsyncTransactionOperations<C>
@Internal public final class AsyncUsingSyncTransactionOperations<C> extends java.lang.Object implements AsyncTransactionOperations<C>
Implementation of the asynchronous transaction manager using a synchronous transaction manager.- Since:
- 3.5.0
- Author:
- Denis Stepanov
-
-
Constructor Summary
Constructors Constructor Description AsyncUsingSyncTransactionOperations(SynchronousTransactionManager<C> synchronousTransactionManager, CoroutineTxHelper coroutineTxHelper)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> java.util.concurrent.CompletionStage<T>
withTransaction(TransactionDefinition definition, java.util.function.Function<AsyncTransactionStatus<C>,java.util.concurrent.CompletionStage<T>> handler)
Execute the given handler with a new transaction.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.micronaut.transaction.async.AsyncTransactionOperations
withTransaction
-
-
-
-
Constructor Detail
-
AsyncUsingSyncTransactionOperations
public AsyncUsingSyncTransactionOperations(SynchronousTransactionManager<C> synchronousTransactionManager, @Nullable CoroutineTxHelper coroutineTxHelper)
-
-
Method Detail
-
withTransaction
public <T> java.util.concurrent.CompletionStage<T> withTransaction(TransactionDefinition definition, java.util.function.Function<AsyncTransactionStatus<C>,java.util.concurrent.CompletionStage<T>> handler)
Description copied from interface:AsyncTransactionOperations
Execute the given handler with a new transaction.- Specified by:
withTransaction
in interfaceAsyncTransactionOperations<C>
- Type Parameters:
T
- The emitted type- Parameters:
definition
- The definitionhandler
- The handler- Returns:
- A publisher that emits the result type
-
-