Package com.google.cloud.spanner
Interface AsyncTransactionManager.AsyncTransactionFunction<I,O>
-
- Enclosing interface:
- AsyncTransactionManager
public static interface AsyncTransactionManager.AsyncTransactionFunction<I,O>
Each step in a transaction chain is defined by anAsyncTransactionManager.AsyncTransactionFunction
. It receives aTransactionContext
and the output value of the previous transaction step as its input parameters. The method should return anApiFuture
that will return the result of this step.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description com.google.api.core.ApiFuture<O>
apply(TransactionContext txn, I input)
This method is called when this transaction step is executed.
-
-
-
Method Detail
-
apply
com.google.api.core.ApiFuture<O> apply(TransactionContext txn, I input) throws Exception
This method is called when this transaction step is executed. The input value is the result of the previous step, and this method will only be called if the previous step executed successfully.- Parameters:
txn
- theTransactionContext
that can be used to execute statements.input
- the result of the previous transaction step.- Returns:
- an
ApiFuture
that will return the result of this step, and that will be the input of the next transaction step. This method should never returnnull
. Instead, if the method does not have a return value, the method should return {@link ApiFutures#immediateFuture(null)}. - Throws:
Exception
-
-