com.google.common.util.concurrent
Interface AsyncFunction<I,O>


@Beta
public interface AsyncFunction<I,O>

Transforms a value, possibly asynchronously. For an example usage and more information, see Futures.transform(ListenableFuture, AsyncFunction).

Since:
11.0
Author:
Chris Povirk

Method Summary
 ListenableFuture<O> apply(I input)
          Returns an output Future to use in place of the given input.
 

Method Detail

apply

ListenableFuture<O> apply(I input)
                          throws Exception
Returns an output Future to use in place of the given input. The output Future need not be done, making AsyncFunction suitable for asynchronous derivations.

Throwing an exception from this method is equivalent to returning a failing Future.

Throws:
Exception


Copyright © 2010-2012. All Rights Reserved.