Package | Description |
---|---|
com.google.common.cache |
This package contains caching utilities.
|
com.google.common.util.concurrent |
Concurrency utilities.
|
com.google.common.util.concurrent.testing |
Modifier and Type | Method and Description |
---|---|
private ListenableFuture<V> |
LocalCache.LoadingValueReference.fullyFailedFuture(java.lang.Throwable t) |
(package private) ListenableFuture<V> |
LocalCache.Segment.loadAsync(K key,
int hash,
LocalCache.LoadingValueReference<K,V> loadingValueReference,
CacheLoader<? super K,V> loader) |
ListenableFuture<V> |
LocalCache.LoadingValueReference.loadFuture(K key,
CacheLoader<? super K,V> loader) |
ListenableFuture<V> |
CacheLoader.reload(K key,
V oldValue)
Computes or retrieves a replacement value corresponding to an already-cached
key . |
Modifier and Type | Method and Description |
---|---|
(package private) V |
LocalCache.Segment.getAndRecordStats(K key,
int hash,
LocalCache.LoadingValueReference<K,V> loadingValueReference,
ListenableFuture<V> newValue)
Waits uninterruptibly for
newValue to be loaded, and then records loading stats. |
Modifier and Type | Interface and Description |
---|---|
interface |
CheckedFuture<V,X extends java.lang.Exception>
Deprecated.
CheckedFuture cannot properly support the chained operations that are the
primary goal of ListenableFuture . CheckedFuture also encourages users to
rethrow exceptions from one thread in another thread, producing misleading stack traces.
Additionally, it has a surprising policy about which exceptions to map and which to leave
untouched. Guava users who want a CheckedFuture can fork the classes for their own
use, possibly specializing them to the particular exception type they use. We recommend that
most people use ListenableFuture and perform any exception wrapping themselves. This
class is scheduled for removal from Guava in February 2018. |
interface |
ListenableScheduledFuture<V>
Helper interface to implement both
ListenableFuture and ScheduledFuture . |
Modifier and Type | Class and Description |
---|---|
(package private) class |
AbstractCatchingFuture<V,X extends java.lang.Throwable,F,T>
Implementations of
Futures.catching* . |
private static class |
AbstractCatchingFuture.AsyncCatchingFuture<V,X extends java.lang.Throwable>
An
AbstractCatchingFuture that delegates to an AsyncFunction and AbstractFuture.setFuture(ListenableFuture) . |
private static class |
AbstractCatchingFuture.CatchingFuture<V,X extends java.lang.Throwable>
|
class |
AbstractCheckedFuture<V,X extends java.lang.Exception>
Deprecated.
CheckedFuture cannot properly support the chained operations that are the
primary goal of ListenableFuture . CheckedFuture also encourages users to
rethrow exceptions from one thread in another thread, producing misleading stack traces.
Additionally, it has a surprising policy about which exceptions to map and which to leave
untouched. Guava users who want a CheckedFuture can fork the classes for their own
use, possibly specializing them to the particular exception type they use. We recommend that
most people use ListenableFuture and perform any exception wrapping themselves. This
class is scheduled for removal from Guava in February 2018. |
class |
AbstractFuture<V>
An abstract implementation of
ListenableFuture , intended for advanced users only. |
(package private) static class |
AbstractFuture.TrustedFuture<V>
A less abstract subclass of AbstractFuture.
|
(package private) class |
AbstractTransformFuture<I,O,F,T>
Implementations of
Futures.transform* . |
private static class |
AbstractTransformFuture.AsyncTransformFuture<I,O>
An
AbstractTransformFuture that delegates to an AsyncFunction and AbstractFuture.setFuture(ListenableFuture) . |
private static class |
AbstractTransformFuture.TransformFuture<I,O>
|
(package private) class |
AggregateFuture<InputT,OutputT>
A future made up of a collection of sub-futures.
|
(package private) class |
CollectionFuture<V,C>
Aggregate future that collects (stores) results of each future.
|
(package private) static class |
CollectionFuture.ListFuture<V>
|
(package private) class |
CombinedFuture<V>
Aggregate future that computes its value by calling a callable.
|
class |
FluentFuture<V>
A
ListenableFuture that supports fluent chains of operations. |
class |
ForwardingCheckedFuture<V,X extends java.lang.Exception>
Deprecated.
CheckedFuture cannot properly support the chained operations that are the
primary goal of ListenableFuture . CheckedFuture also encourages users to
rethrow exceptions from one thread in another thread, producing misleading stack traces.
Additionally, it has a surprising policy about which exceptions to map and which to leave
untouched. Guava users who want a CheckedFuture can fork the classes for their own
use, possibly specializing them to the particular exception type they use. We recommend that
most people use ListenableFuture and perform any exception wrapping themselves. This
class is scheduled for removal from Guava in February 2018. |
static class |
ForwardingCheckedFuture.SimpleForwardingCheckedFuture<V,X extends java.lang.Exception>
Deprecated.
CheckedFuture cannot properly support the chained operations that are the
primary goal of ListenableFuture . CheckedFuture also encourages users to
rethrow exceptions from one thread in another thread, producing misleading stack traces.
Additionally, it has a surprising policy about which exceptions to map and which to leave
untouched. Guava users who want a CheckedFuture can fork the classes for their own
use, possibly specializing them to the particular exception type they use. We recommend
that most people use ListenableFuture and perform any exception wrapping
themselves. This class is scheduled for removal from Guava in February 2018. |
(package private) class |
ForwardingFluentFuture<V>
FluentFuture that forwards all calls to a delegate. |
class |
ForwardingListenableFuture<V>
A
ListenableFuture which forwards all its method calls to another future. |
static class |
ForwardingListenableFuture.SimpleForwardingListenableFuture<V>
A simplified version of
ForwardingListenableFuture where subclasses can pass in an
already constructed ListenableFuture as the delegate. |
private static class |
Futures.InCompletionOrderFuture<T> |
private static class |
Futures.MappingCheckedFuture<V,X extends java.lang.Exception>
A checked future that uses a function to map from exceptions to the appropriate checked type.
|
private static class |
Futures.NonCancellationPropagatingFuture<V>
A wrapped future that does not propagate cancellation to its delegate.
|
(package private) class |
GwtFluentFutureCatchingSpecialization<V>
Hidden superclass of
FluentFuture that provides us a place to declare special GWT
versions of the FluentFuture.catching family of methods. |
(package private) class |
ImmediateFuture<V>
Implementations of
Futures.immediate* . |
(package private) static class |
ImmediateFuture.ImmediateCancelledFuture<V> |
(package private) static class |
ImmediateFuture.ImmediateFailedCheckedFuture<V,X extends java.lang.Exception> |
(package private) static class |
ImmediateFuture.ImmediateFailedFuture<V> |
(package private) static class |
ImmediateFuture.ImmediateSuccessfulCheckedFuture<V,X extends java.lang.Exception> |
(package private) static class |
ImmediateFuture.ImmediateSuccessfulFuture<V> |
private static class |
JdkFutureAdapters.ListenableFutureAdapter<V>
An adapter to turn a
Future into a ListenableFuture . |
class |
ListenableFutureTask<V>
A
FutureTask that also implements the ListenableFuture interface. |
private static class |
MoreExecutors.ScheduledListeningDecorator.ListenableScheduledTask<V> |
private static class |
MoreExecutors.ScheduledListeningDecorator.NeverSuccessfulListenableFutureTask |
class |
SettableFuture<V>
A
ListenableFuture whose result can be set by a SettableFuture.set(Object) , SettableFuture.setException(Throwable) or SettableFuture.setFuture(ListenableFuture) call. |
(package private) class |
TimeoutFuture<V>
Implementation of
Futures#withTimeout . |
(package private) class |
TrustedListenableFutureTask<V>
A
RunnableFuture that also implements the ListenableFuture interface. |
Modifier and Type | Field and Description |
---|---|
private ListenableFuture<V> |
ForwardingFluentFuture.delegate |
private ListenableFuture<V> |
ForwardingListenableFuture.SimpleForwardingListenableFuture.delegate |
private ListenableFuture<V> |
Futures.NonCancellationPropagatingFuture.delegate |
private ListenableFuture<V> |
TimeoutFuture.delegateRef |
(package private) ListenableFuture<? extends V> |
AbstractFuture.SetFuture.future |
(package private) ListenableFuture<? extends V> |
AbstractCatchingFuture.inputFuture |
(package private) ListenableFuture<? extends I> |
AbstractTransformFuture.inputFuture |
private ListenableFuture<? extends T>[] |
Futures.InCompletionOrderState.inputFutures |
Modifier and Type | Field and Description |
---|---|
private ImmutableCollection<? extends ListenableFuture<? extends InputT>> |
AggregateFuture.RunningState.futures |
private ImmutableList<ListenableFuture<? extends V>> |
Futures.FutureCombiner.futures |
Modifier and Type | Method and Description |
---|---|
static <V> ListenableFuture<java.util.List<V>> |
Futures.allAsList(java.lang.Iterable<? extends ListenableFuture<? extends V>> futures)
Creates a new
ListenableFuture whose value is a list containing the values of all its
input futures, if all succeed. |
static <V> ListenableFuture<java.util.List<V>> |
Futures.allAsList(ListenableFuture<? extends V>... futures)
Creates a new
ListenableFuture whose value is a list containing the values of all its
input futures, if all succeed. |
ListenableFuture<O> |
AsyncFunction.apply(I input)
Returns an output
Future to use in place of the given input . |
ListenableFuture<V> |
AsyncCallable.call()
Computes a result
Future . |
<C> ListenableFuture<C> |
Futures.FutureCombiner.call(java.util.concurrent.Callable<C> combiner)
Deprecated.
Use the overload that requires an
executor. For identical behavior, pass
MoreExecutors.directExecutor() , but
consider whether another executor would be safer, as discussed in the ListenableFuture.addListener documentation. This method is
scheduled to be removed in July 2018. |
<C> ListenableFuture<C> |
Futures.FutureCombiner.call(java.util.concurrent.Callable<C> combiner,
java.util.concurrent.Executor executor)
Creates the
ListenableFuture which will return the result of calling Callable.call() in combiner when all futures complete, using the specified executor . |
<C> ListenableFuture<C> |
Futures.FutureCombiner.callAsync(AsyncCallable<C> combiner)
Deprecated.
Use the overload that requires an
executor. For identical behavior, pass
MoreExecutors.directExecutor() , but
consider whether another executor would be safer, as discussed in the ListenableFuture.addListener documentation. This method is
scheduled to be removed in July 2018. |
<C> ListenableFuture<C> |
Futures.FutureCombiner.callAsync(AsyncCallable<C> combiner,
java.util.concurrent.Executor executor)
Creates the
ListenableFuture which will return the result of calling AsyncCallable.call() in combiner when all futures complete, using the specified executor . |
static <V,X extends java.lang.Throwable> |
Futures.catching(ListenableFuture<? extends V> input,
java.lang.Class<X> exceptionType,
Function<? super X,? extends V> fallback)
Deprecated.
Use the overload
that requires an executor. For identical behavior, pass
MoreExecutors.directExecutor() , but consider whether another executor would be safer, as
discussed in the ListenableFuture.addListener
documentation. This method is scheduled to be removed in July 2018. |
static <V,X extends java.lang.Throwable> |
Futures.catching(ListenableFuture<? extends V> input,
java.lang.Class<X> exceptionType,
Function<? super X,? extends V> fallback,
java.util.concurrent.Executor executor)
Returns a
Future whose result is taken from the given primary input or, if the
primary input fails with the given exceptionType , from the result provided by the
fallback . |
static <V,X extends java.lang.Throwable> |
Futures.catchingAsync(ListenableFuture<? extends V> input,
java.lang.Class<X> exceptionType,
AsyncFunction<? super X,? extends V> fallback)
Deprecated.
Use the overload that requires an executor. For identical behavior, pass
MoreExecutors.directExecutor() , but consider whether another executor would be safer, as
discussed in the ListenableFuture.addListener
documentation. This method is scheduled to be removed in July 2018. |
static <V,X extends java.lang.Throwable> |
Futures.catchingAsync(ListenableFuture<? extends V> input,
java.lang.Class<X> exceptionType,
AsyncFunction<? super X,? extends V> fallback,
java.util.concurrent.Executor executor)
Returns a
Future whose result is taken from the given primary input or, if the
primary input fails with the given exceptionType , from the result provided by the
fallback . |
(package private) static <X extends java.lang.Throwable,V> |
AbstractCatchingFuture.create(ListenableFuture<? extends V> input,
java.lang.Class<X> exceptionType,
AsyncFunction<? super X,? extends V> fallback,
java.util.concurrent.Executor executor) |
(package private) static <V,X extends java.lang.Throwable> |
AbstractCatchingFuture.create(ListenableFuture<? extends V> input,
java.lang.Class<X> exceptionType,
Function<? super X,? extends V> fallback,
java.util.concurrent.Executor executor) |
(package private) static <I,O> ListenableFuture<O> |
AbstractTransformFuture.create(ListenableFuture<I> input,
AsyncFunction<? super I,? extends O> function,
java.util.concurrent.Executor executor) |
(package private) static <I,O> ListenableFuture<O> |
AbstractTransformFuture.create(ListenableFuture<I> input,
Function<? super I,? extends O> function,
java.util.concurrent.Executor executor) |
(package private) static <V> ListenableFuture<V> |
TimeoutFuture.create(ListenableFuture<V> delegate,
long time,
java.util.concurrent.TimeUnit unit,
java.util.concurrent.ScheduledExecutorService scheduledExecutor) |
protected abstract ListenableFuture<? extends V> |
ForwardingListenableFuture.delegate() |
protected ListenableFuture<V> |
ForwardingListenableFuture.SimpleForwardingListenableFuture.delegate() |
(package private) ListenableFuture<? extends V> |
AbstractCatchingFuture.AsyncCatchingFuture.doFallback(AsyncFunction<? super X,? extends V> fallback,
X cause) |
(package private) ListenableFuture<? extends O> |
AbstractTransformFuture.AsyncTransformFuture.doTransform(AsyncFunction<? super I,? extends O> function,
I input) |
static <V> ListenableFuture<V> |
Futures.immediateCancelledFuture()
Creates a
ListenableFuture which is cancelled immediately upon construction, so that
isCancelled() always returns true . |
static <V> ListenableFuture<V> |
Futures.immediateFailedFuture(java.lang.Throwable throwable)
Returns a
ListenableFuture which has an exception set immediately upon construction. |
static <V> ListenableFuture<V> |
Futures.immediateFuture(V value)
Creates a
ListenableFuture which has its value set immediately upon construction. |
static <V> ListenableFuture<V> |
JdkFutureAdapters.listenInPoolThread(java.util.concurrent.Future<V> future)
Assigns a thread to the given
Future to provide ListenableFuture functionality. |
static <V> ListenableFuture<V> |
JdkFutureAdapters.listenInPoolThread(java.util.concurrent.Future<V> future,
java.util.concurrent.Executor executor)
Submits a blocking task for the given
Future to provide ListenableFuture
functionality. |
static <V> ListenableFuture<V> |
Futures.nonCancellationPropagating(ListenableFuture<V> future)
Returns a
ListenableFuture whose result is set from the supplied future when it
completes. |
ListenableFuture<?> |
Futures.FutureCombiner.run(java.lang.Runnable combiner,
java.util.concurrent.Executor executor)
Creates the
ListenableFuture which will return the result of running combiner
when all Futures complete. |
(package private) ListenableFuture<V> |
CombinedFuture.AsyncCallableInterruptibleTask.runInterruptibly() |
(package private) ListenableFuture<V> |
TrustedListenableFutureTask.TrustedFutureInterruptibleAsyncTask.runInterruptibly() |
static <O> ListenableFuture<O> |
Futures.scheduleAsync(AsyncCallable<O> callable,
long delay,
java.util.concurrent.TimeUnit timeUnit,
java.util.concurrent.ScheduledExecutorService executorService)
Schedules
callable on the specified executor , returning a Future . |
<T> ListenableFuture<T> |
AbstractListeningExecutorService.submit(java.util.concurrent.Callable<T> task) |
<T> ListenableFuture<T> |
ForwardingListeningExecutorService.submit(java.util.concurrent.Callable<T> task) |
<T> ListenableFuture<T> |
ListeningExecutorService.submit(java.util.concurrent.Callable<T> task) |
ListenableFuture<?> |
AbstractListeningExecutorService.submit(java.lang.Runnable task) |
ListenableFuture<?> |
ForwardingListeningExecutorService.submit(java.lang.Runnable task) |
ListenableFuture<?> |
ListeningExecutorService.submit(java.lang.Runnable task) |
<T> ListenableFuture<T> |
AbstractListeningExecutorService.submit(java.lang.Runnable task,
T result) |
<T> ListenableFuture<T> |
ForwardingListeningExecutorService.submit(java.lang.Runnable task,
T result) |
<T> ListenableFuture<T> |
ListeningExecutorService.submit(java.lang.Runnable task,
T result) |
private static <T> ListenableFuture<T> |
MoreExecutors.submitAndAddQueueListener(ListeningExecutorService executorService,
java.util.concurrent.Callable<T> task,
java.util.concurrent.BlockingQueue<java.util.concurrent.Future<T>> queue)
Submits the task and adds a listener that adds the future to
queue when it completes. |
static <O> ListenableFuture<O> |
Futures.submitAsync(AsyncCallable<O> callable,
java.util.concurrent.Executor executor)
Executes
callable on the specified executor , returning a Future . |
static <V> ListenableFuture<java.util.List<V>> |
Futures.successfulAsList(java.lang.Iterable<? extends ListenableFuture<? extends V>> futures)
Creates a new
ListenableFuture whose value is a list containing the values of all its
successful input futures. |
static <V> ListenableFuture<java.util.List<V>> |
Futures.successfulAsList(ListenableFuture<? extends V>... futures)
Creates a new
ListenableFuture whose value is a list containing the values of all its
successful input futures. |
static <I,O> ListenableFuture<O> |
Futures.transform(ListenableFuture<I> input,
Function<? super I,? extends O> function)
Deprecated.
Use the overload that
requires an executor. For identical behavior, pass
MoreExecutors.directExecutor() ,
but consider whether another executor would be safer, as discussed in the ListenableFuture.addListener documentation. This method is
scheduled to be removed in July 2018. |
static <I,O> ListenableFuture<O> |
Futures.transform(ListenableFuture<I> input,
Function<? super I,? extends O> function,
java.util.concurrent.Executor executor)
Returns a new
Future whose result is derived from the result of the given Future . |
static <I,O> ListenableFuture<O> |
Futures.transformAsync(ListenableFuture<I> input,
AsyncFunction<? super I,? extends O> function)
Deprecated.
Use the
overload that requires an executor. For identical behavior, pass
MoreExecutors.directExecutor() , but consider whether another executor would be safer, as
discussed in the ListenableFuture.addListener
documentation. This method is scheduled to be removed in July 2018. |
static <I,O> ListenableFuture<O> |
Futures.transformAsync(ListenableFuture<I> input,
AsyncFunction<? super I,? extends O> function,
java.util.concurrent.Executor executor)
Returns a new
Future whose result is asynchronously derived from the result of the
given Future . |
static <V> ListenableFuture<V> |
Futures.withTimeout(ListenableFuture<V> delegate,
long time,
java.util.concurrent.TimeUnit unit,
java.util.concurrent.ScheduledExecutorService scheduledExecutor)
Returns a future that delegates to another but will finish early (via a
TimeoutException wrapped in an ExecutionException ) if the specified duration expires. |
Modifier and Type | Method and Description |
---|---|
static <T> ImmutableList<ListenableFuture<T>> |
Futures.inCompletionOrder(java.lang.Iterable<? extends ListenableFuture<? extends T>> futures)
Returns a list of delegate futures that correspond to the futures received in the order that
they complete.
|
Modifier and Type | Method and Description |
---|---|
static <V> void |
Futures.addCallback(ListenableFuture<V> future,
FutureCallback<? super V> callback)
Deprecated.
Use the
overload that requires an executor. For identical behavior, pass
MoreExecutors.directExecutor() , but consider whether another executor would be safer, as
discussed in the ListenableFuture.addListener
documentation. This method is scheduled to be removed in July 2018. |
static <V> void |
Futures.addCallback(ListenableFuture<V> future,
FutureCallback<? super V> callback,
java.util.concurrent.Executor executor)
Registers separate success and failure callbacks to be run when the
Future 's
computation is complete or, if the
computation is already complete, immediately. |
(package private) void |
TrustedListenableFutureTask.TrustedFutureInterruptibleAsyncTask.afterRanInterruptibly(ListenableFuture<V> result,
java.lang.Throwable error) |
static <V> ListenableFuture<java.util.List<V>> |
Futures.allAsList(ListenableFuture<? extends V>... futures)
Creates a new
ListenableFuture whose value is a list containing the values of all its
input futures, if all succeed. |
static <V,X extends java.lang.Throwable> |
Futures.catching(ListenableFuture<? extends V> input,
java.lang.Class<X> exceptionType,
Function<? super X,? extends V> fallback)
Deprecated.
Use the overload
that requires an executor. For identical behavior, pass
MoreExecutors.directExecutor() , but consider whether another executor would be safer, as
discussed in the ListenableFuture.addListener
documentation. This method is scheduled to be removed in July 2018. |
static <V,X extends java.lang.Throwable> |
Futures.catching(ListenableFuture<? extends V> input,
java.lang.Class<X> exceptionType,
Function<? super X,? extends V> fallback,
java.util.concurrent.Executor executor)
Returns a
Future whose result is taken from the given primary input or, if the
primary input fails with the given exceptionType , from the result provided by the
fallback . |
static <V,X extends java.lang.Throwable> |
Futures.catchingAsync(ListenableFuture<? extends V> input,
java.lang.Class<X> exceptionType,
AsyncFunction<? super X,? extends V> fallback)
Deprecated.
Use the overload that requires an executor. For identical behavior, pass
MoreExecutors.directExecutor() , but consider whether another executor would be safer, as
discussed in the ListenableFuture.addListener
documentation. This method is scheduled to be removed in July 2018. |
static <V,X extends java.lang.Throwable> |
Futures.catchingAsync(ListenableFuture<? extends V> input,
java.lang.Class<X> exceptionType,
AsyncFunction<? super X,? extends V> fallback,
java.util.concurrent.Executor executor)
Returns a
Future whose result is taken from the given primary input or, if the
primary input fails with the given exceptionType , from the result provided by the
fallback . |
(package private) static <X extends java.lang.Throwable,V> |
AbstractCatchingFuture.create(ListenableFuture<? extends V> input,
java.lang.Class<X> exceptionType,
AsyncFunction<? super X,? extends V> fallback,
java.util.concurrent.Executor executor) |
(package private) static <V,X extends java.lang.Throwable> |
AbstractCatchingFuture.create(ListenableFuture<? extends V> input,
java.lang.Class<X> exceptionType,
Function<? super X,? extends V> fallback,
java.util.concurrent.Executor executor) |
(package private) static <I,O> ListenableFuture<O> |
AbstractTransformFuture.create(ListenableFuture<I> input,
AsyncFunction<? super I,? extends O> function,
java.util.concurrent.Executor executor) |
(package private) static <I,O> ListenableFuture<O> |
AbstractTransformFuture.create(ListenableFuture<I> input,
Function<? super I,? extends O> function,
java.util.concurrent.Executor executor) |
(package private) static <V> ListenableFuture<V> |
TimeoutFuture.create(ListenableFuture<V> delegate,
long time,
java.util.concurrent.TimeUnit unit,
java.util.concurrent.ScheduledExecutorService scheduledExecutor) |
static <V> FluentFuture<V> |
FluentFuture.from(ListenableFuture<V> future)
Converts the given
ListenableFuture to an equivalent FluentFuture . |
private static java.lang.Object |
AbstractFuture.getFutureValue(ListenableFuture<?> future)
Returns a value that satisfies the contract of the
AbstractFuture.value field based on the state of
given future. |
static <V,X extends java.lang.Exception> |
Futures.makeChecked(ListenableFuture<V> future,
Function<? super java.lang.Exception,X> mapper)
Deprecated.
CheckedFuture cannot properly support the chained operations that are the
primary goal of ListenableFuture . CheckedFuture also encourages users to
rethrow exceptions from one thread in another thread, producing misleading stack traces.
Additionally, it has a surprising policy about which exceptions to map and which to leave
untouched. Guava users who want a CheckedFuture can fork the classes for their own
use, possibly specializing them to the particular exception type they use. We recommend
that most people use ListenableFuture and perform any exception wrapping
themselves. This method is scheduled for removal from Guava in July 2018. |
static <V> ListenableFuture<V> |
Futures.nonCancellationPropagating(ListenableFuture<V> future)
Returns a
ListenableFuture whose result is set from the supplied future when it
completes. |
protected boolean |
AbstractFuture.setFuture(ListenableFuture<? extends V> future)
Sets the result of this
Future to match the supplied input Future once the
supplied Future is done, unless this Future has already been cancelled or set
(including "set asynchronously," defined below). |
boolean |
SettableFuture.setFuture(ListenableFuture<? extends V> future) |
(package private) void |
AbstractTransformFuture.AsyncTransformFuture.setResult(ListenableFuture<? extends O> result) |
(package private) void |
AbstractCatchingFuture.AsyncCatchingFuture.setResult(ListenableFuture<? extends V> result) |
(package private) void |
CombinedFuture.AsyncCallableInterruptibleTask.setValue(ListenableFuture<V> value) |
static <V> ListenableFuture<java.util.List<V>> |
Futures.successfulAsList(ListenableFuture<? extends V>... futures)
Creates a new
ListenableFuture whose value is a list containing the values of all its
successful input futures. |
static <I,O> ListenableFuture<O> |
Futures.transform(ListenableFuture<I> input,
Function<? super I,? extends O> function)
Deprecated.
Use the overload that
requires an executor. For identical behavior, pass
MoreExecutors.directExecutor() ,
but consider whether another executor would be safer, as discussed in the ListenableFuture.addListener documentation. This method is
scheduled to be removed in July 2018. |
static <I,O> ListenableFuture<O> |
Futures.transform(ListenableFuture<I> input,
Function<? super I,? extends O> function,
java.util.concurrent.Executor executor)
Returns a new
Future whose result is derived from the result of the given Future . |
static <I,O> ListenableFuture<O> |
Futures.transformAsync(ListenableFuture<I> input,
AsyncFunction<? super I,? extends O> function)
Deprecated.
Use the
overload that requires an executor. For identical behavior, pass
MoreExecutors.directExecutor() , but consider whether another executor would be safer, as
discussed in the ListenableFuture.addListener
documentation. This method is scheduled to be removed in July 2018. |
static <I,O> ListenableFuture<O> |
Futures.transformAsync(ListenableFuture<I> input,
AsyncFunction<? super I,? extends O> function,
java.util.concurrent.Executor executor)
Returns a new
Future whose result is asynchronously derived from the result of the
given Future . |
static <V> Futures.FutureCombiner<V> |
Futures.whenAllComplete(ListenableFuture<? extends V>... futures)
Creates a
Futures.FutureCombiner that processes the completed futures whether or not they're
successful. |
static <V> Futures.FutureCombiner<V> |
Futures.whenAllSucceed(ListenableFuture<? extends V>... futures)
Creates a
Futures.FutureCombiner requiring that all passed in futures are successful. |
static <V> ListenableFuture<V> |
Futures.withTimeout(ListenableFuture<V> delegate,
long time,
java.util.concurrent.TimeUnit unit,
java.util.concurrent.ScheduledExecutorService scheduledExecutor)
Returns a future that delegates to another but will finish early (via a
TimeoutException wrapped in an ExecutionException ) if the specified duration expires. |
Modifier and Type | Method and Description |
---|---|
static <V> ListenableFuture<java.util.List<V>> |
Futures.allAsList(java.lang.Iterable<? extends ListenableFuture<? extends V>> futures)
Creates a new
ListenableFuture whose value is a list containing the values of all its
input futures, if all succeed. |
static <T> ImmutableList<ListenableFuture<T>> |
Futures.inCompletionOrder(java.lang.Iterable<? extends ListenableFuture<? extends T>> futures)
Returns a list of delegate futures that correspond to the futures received in the order that
they complete.
|
static <V> ListenableFuture<java.util.List<V>> |
Futures.successfulAsList(java.lang.Iterable<? extends ListenableFuture<? extends V>> futures)
Creates a new
ListenableFuture whose value is a list containing the values of all its
successful input futures. |
static <V> Futures.FutureCombiner<V> |
Futures.whenAllComplete(java.lang.Iterable<? extends ListenableFuture<? extends V>> futures)
Creates a
Futures.FutureCombiner that processes the completed futures whether or not they're
successful. |
static <V> Futures.FutureCombiner<V> |
Futures.whenAllSucceed(java.lang.Iterable<? extends ListenableFuture<? extends V>> futures)
Creates a
Futures.FutureCombiner requiring that all passed in futures are successful. |
Constructor and Description |
---|
AbstractCatchingFuture(ListenableFuture<? extends V> inputFuture,
java.lang.Class<X> exceptionType,
F fallback) |
AbstractCheckedFuture(ListenableFuture<V> delegate)
Deprecated.
Constructs an
AbstractCheckedFuture that wraps a delegate. |
AbstractTransformFuture(ListenableFuture<? extends I> inputFuture,
F function) |
AsyncCatchingFuture(ListenableFuture<? extends V> input,
java.lang.Class<X> exceptionType,
AsyncFunction<? super X,? extends V> fallback) |
AsyncTransformFuture(ListenableFuture<? extends I> inputFuture,
AsyncFunction<? super I,? extends O> function) |
CatchingFuture(ListenableFuture<? extends V> input,
java.lang.Class<X> exceptionType,
Function<? super X,? extends V> fallback) |
ForwardingFluentFuture(ListenableFuture<V> delegate) |
InCompletionOrderState(ListenableFuture<? extends T>[] inputFutures) |
ListenableScheduledTask(ListenableFuture<V> listenableDelegate,
java.util.concurrent.ScheduledFuture<?> scheduledDelegate) |
MappingCheckedFuture(ListenableFuture<V> delegate,
Function<? super java.lang.Exception,X> mapper) |
NonCancellationPropagatingFuture(ListenableFuture<V> delegate) |
SetFuture(AbstractFuture<V> owner,
ListenableFuture<? extends V> future) |
SimpleForwardingListenableFuture(ListenableFuture<V> delegate) |
TimeoutFuture(ListenableFuture<V> delegate) |
TransformFuture(ListenableFuture<? extends I> inputFuture,
Function<? super I,? extends O> function) |
Constructor and Description |
---|
CollectionFutureRunningState(ImmutableCollection<? extends ListenableFuture<? extends V>> futures,
boolean allMustSucceed) |
CombinedFuture(ImmutableCollection<? extends ListenableFuture<?>> futures,
boolean allMustSucceed,
java.util.concurrent.Executor listenerExecutor,
AsyncCallable<V> callable) |
CombinedFuture(ImmutableCollection<? extends ListenableFuture<?>> futures,
boolean allMustSucceed,
java.util.concurrent.Executor listenerExecutor,
java.util.concurrent.Callable<V> callable) |
CombinedFutureRunningState(ImmutableCollection<? extends ListenableFuture<?>> futures,
boolean allMustSucceed,
CombinedFuture.CombinedFutureInterruptibleTask task) |
FutureCombiner(boolean allMustSucceed,
ImmutableList<ListenableFuture<? extends V>> futures) |
ListFuture(ImmutableCollection<? extends ListenableFuture<? extends V>> futures,
boolean allMustSucceed) |
ListFutureRunningState(ImmutableCollection<? extends ListenableFuture<? extends V>> futures,
boolean allMustSucceed) |
RunningState(ImmutableCollection<? extends ListenableFuture<? extends InputT>> futures,
boolean allMustSucceed,
boolean collectsValues) |
Modifier and Type | Class and Description |
---|---|
private static class |
SameThreadScheduledExecutorService.ImmediateScheduledFuture<V> |
private static class |
TestingExecutors.NoOpScheduledExecutorService.NeverScheduledFuture<V> |
Modifier and Type | Field and Description |
---|---|
protected ListenableFuture<java.lang.Boolean> |
AbstractListenableFutureTest.future |
private ListenableFuture<?> |
MockFutureListener.future |
Modifier and Type | Method and Description |
---|---|
protected <V> ListenableFuture<V> |
AbstractCheckedFutureTest.createListenableFuture(V value,
java.lang.Exception except,
java.util.concurrent.CountDownLatch waitOn) |
protected abstract <V> ListenableFuture<V> |
AbstractListenableFutureTest.createListenableFuture(V value,
java.lang.Exception except,
java.util.concurrent.CountDownLatch waitOn)
Constructs a listenable future with a value available after the latch has counted down.
|
<T> ListenableFuture<T> |
SameThreadScheduledExecutorService.submit(java.util.concurrent.Callable<T> task) |
ListenableFuture<?> |
SameThreadScheduledExecutorService.submit(java.lang.Runnable task) |
<T> ListenableFuture<T> |
SameThreadScheduledExecutorService.submit(java.lang.Runnable task,
T result) |
Constructor and Description |
---|
ImmediateScheduledFuture(ListenableFuture<V> future) |
MockFutureListener(ListenableFuture<?> future) |