Package | Description |
---|---|
com.google.common.util.concurrent |
Concurrency utilities.
|
Modifier and Type | Class and Description |
---|---|
class |
AbstractFuture<V>
An abstract implementation of
ListenableFuture , intended for advanced users only. |
class |
SettableFuture<V>
A
ListenableFuture whose result can be set by a SettableFuture.set(Object) , SettableFuture.setException(Throwable) or SettableFuture.setFuture(ListenableFuture) call. |
Modifier and Type | Method and Description |
---|---|
<X extends Throwable> |
FluentFuture.catching(Class<X> exceptionType,
Function<? super X,? extends V> fallback,
Executor executor)
Returns a
Future whose result is taken from this Future or, if this Future fails with the given exceptionType , from the result provided by the fallback . |
<X extends Throwable> |
FluentFuture.catchingAsync(Class<X> exceptionType,
AsyncFunction<? super X,? extends V> fallback,
Executor executor)
Returns a
Future whose result is taken from this Future or, if the this Future fails with the given exceptionType , from the result provided by the fallback . |
static <V> FluentFuture<V> |
FluentFuture.from(ListenableFuture<V> future)
Converts the given
ListenableFuture to an equivalent FluentFuture . |
<T> FluentFuture<T> |
FluentFuture.transform(Function<? super V,T> function,
Executor executor)
Returns a new
Future whose result is derived from the result of this Future . |
<T> FluentFuture<T> |
FluentFuture.transformAsync(AsyncFunction<? super V,T> function,
Executor executor)
Returns a new
Future whose result is asynchronously derived from the result of this
Future . |
FluentFuture<V> |
FluentFuture.withTimeout(long timeout,
TimeUnit unit,
ScheduledExecutorService scheduledExecutor)
Returns a future that delegates to this future but will finish early (via a
TimeoutException wrapped in an ExecutionException ) if the specified timeout expires. |
Copyright © 2010–2018. All rights reserved.