Module dev.mccue.guava.concurrent
Package dev.mccue.guava.concurrent
Interface AsyncFunction<I extends @Nullable Object,O extends @Nullable Object>
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface
public interface AsyncFunction<I extends @Nullable Object,O extends @Nullable Object>
Transforms a value, possibly asynchronously. For an example usage and more information, see
Futures#transformAsync(ListenableFuture, AsyncFunction, Executor).- Since:
- 11.0
- Author:
- Chris Povirk
-
Method Summary
Modifier and TypeMethodDescriptionReturns an outputFutureto use in place of the giveninput.
-
Method Details
-
apply
Returns an outputFutureto use in place of the giveninput. The outputFutureneed not beFuture#isDone done, makingAsyncFunctionsuitable for asynchronous derivations.Throwing an exception from this method is equivalent to returning a failing
Future.- Throws:
Exception
-