Package io.micronaut.transaction.async
Interface AsyncTransactionOperations<C>
-
- Type Parameters:
C
- The connection type
- All Known Implementing Classes:
AsyncUsingReactiveTransactionOperations
,AsyncUsingSyncTransactionOperations
public interface AsyncTransactionOperations<C>
An interface for async transaction management.- Since:
- 3.5.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default 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.default <T> java.util.concurrent.CompletionStage<T>
withTransaction(java.util.function.Function<AsyncTransactionStatus<C>,java.util.concurrent.CompletionStage<T>> handler)
Execute the given handler with a new transaction.
-
-
-
Method Detail
-
withTransaction
@NonNull <T> java.util.concurrent.CompletionStage<T> withTransaction(@NonNull TransactionDefinition definition, @NonNull java.util.function.Function<AsyncTransactionStatus<C>,java.util.concurrent.CompletionStage<T>> handler)
Execute the given handler with a new transaction.- Type Parameters:
T
- The emitted type- Parameters:
definition
- The definitionhandler
- The handler- Returns:
- A publisher that emits the result type
-
withTransaction
@NonNull default <T> java.util.concurrent.CompletionStage<T> withTransaction(@NonNull java.util.function.Function<AsyncTransactionStatus<C>,java.util.concurrent.CompletionStage<T>> handler)
Execute the given handler with a new transaction.- Type Parameters:
T
- The emitted type- Parameters:
handler
- The handler- Returns:
- A publisher that emits the result type
-
-