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
Modifier and TypeMethodDescriptiondefault Optional<? extends AsyncTransactionStatus<?>>
Find optional propagated transaction status.<T> @NonNull CompletionStage<T>
withTransaction
(@NonNull TransactionDefinition definition, @NonNull Function<AsyncTransactionStatus<C>, CompletionStage<T>> handler) Execute the given handler with a new transaction.default <T> @NonNull CompletionStage<T>
withTransaction
(@NonNull Function<AsyncTransactionStatus<C>, CompletionStage<T>> handler) Execute the given handler with a new transaction.
-
Method Details
-
findTransactionStatus
Find optional propagated transaction status.- Returns:
- The transaction status.
-
withTransaction
@NonNull <T> @NonNull CompletionStage<T> withTransaction(@NonNull @NonNull TransactionDefinition definition, @NonNull @NonNull Function<AsyncTransactionStatus<C>, 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> @NonNull CompletionStage<T> withTransaction(@NonNull @NonNull Function<AsyncTransactionStatus<C>, 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
-