Package | Description |
---|---|
com.google.common.util.concurrent |
Concurrency utilities.
|
Modifier and Type | Field and Description |
---|---|
private V |
ImmediateFuture.value |
Modifier and Type | Method and Description |
---|---|
U |
ClosingFuture.ClosingFunction.apply(ClosingFuture.DeferredCloser closer,
T input)
Applies this function to an input, or throws an exception if unable to do so.
|
U |
ClosingFuture.Combiner2.ClosingFunction2.apply(ClosingFuture.DeferredCloser closer,
V1 value1,
V2 value2)
Applies this function to two inputs, or throws an exception if unable to do so.
|
U |
ClosingFuture.Combiner3.ClosingFunction3.apply(ClosingFuture.DeferredCloser closer,
V1 value1,
V2 value2,
V3 value3)
Applies this function to three inputs, or throws an exception if unable to do so.
|
U |
ClosingFuture.Combiner4.ClosingFunction4.apply(ClosingFuture.DeferredCloser closer,
V1 value1,
V2 value2,
V3 value3,
V4 value4)
Applies this function to four inputs, or throws an exception if unable to do so.
|
U |
ClosingFuture.Combiner5.ClosingFunction5.apply(ClosingFuture.DeferredCloser closer,
V1 value1,
V2 value2,
V3 value3,
V4 value4,
V5 value5)
Applies this function to five inputs, or throws an exception if unable to do so.
|
private <V> V |
ClosingFuture.Peeker.call(ClosingFuture.Combiner.CombiningCallable<V> combiner,
ClosingFuture.CloseableList closeables) |
V |
ClosingFuture.ClosingCallable.call(ClosingFuture.DeferredCloser closer)
Computes a result, or throws an exception if unable to do so.
|
V |
ClosingFuture.Combiner.CombiningCallable.call(ClosingFuture.DeferredCloser closer,
ClosingFuture.Peeker peeker)
Computes a result, or throws an exception if unable to do so.
|
<T> T |
FakeTimeLimiter.callUninterruptiblyWithTimeout(java.util.concurrent.Callable<T> callable,
long timeoutDuration,
java.util.concurrent.TimeUnit timeoutUnit) |
<T> T |
FakeTimeLimiter.callWithTimeout(java.util.concurrent.Callable<T> callable,
long timeoutDuration,
java.util.concurrent.TimeUnit timeoutUnit) |
(package private) V |
AbstractCatchingFuture.CatchingFuture.doFallback(Function<? super X,? extends V> fallback,
X cause) |
(package private) abstract T |
AbstractCatchingFuture.doFallback(F fallback,
X throwable)
Template method for subtypes to actually run the fallback.
|
(package private) abstract T |
AbstractTransformFuture.doTransform(F function,
I result)
Template method for subtypes to actually run the transform.
|
(package private) O |
AbstractTransformFuture.TransformFuture.doTransform(Function<? super I,? extends O> function,
I input) |
<C extends java.lang.Object & java.lang.AutoCloseable> |
ClosingFuture.DeferredCloser.eventuallyClose(C closeable,
java.util.concurrent.Executor closingExecutor)
Captures an object to be closed when a
ClosingFuture pipeline is done. |
V |
ImmediateFuture.get() |
V |
ForwardingFuture.get() |
V |
ForwardingFluentFuture.get() |
V |
FluentFuture.TrustedFuture.get() |
V |
ClosingFuture.ValueAndCloser.get()
Returns the final value of the associated
ClosingFuture , or throws an exception as
Future.get() would. |
V |
AbstractFuture.get() |
V |
AbstractFuture.TrustedFuture.get() |
V |
ListenableFutureTask.get(long timeout,
java.util.concurrent.TimeUnit unit) |
V |
ImmediateFuture.get(long timeout,
java.util.concurrent.TimeUnit unit) |
V |
ForwardingFuture.get(long timeout,
java.util.concurrent.TimeUnit unit) |
V |
ForwardingFluentFuture.get(long timeout,
java.util.concurrent.TimeUnit unit) |
V |
FluentFuture.TrustedFuture.get(long timeout,
java.util.concurrent.TimeUnit unit) |
V |
AbstractFuture.get(long timeout,
java.util.concurrent.TimeUnit unit) |
V |
AbstractFuture.TrustedFuture.get(long timeout,
java.util.concurrent.TimeUnit unit) |
(package private) static <V,X extends java.lang.Exception> |
FuturesGetChecked.getChecked(java.util.concurrent.Future<V> future,
java.lang.Class<X> exceptionClass) |
static <V,X extends java.lang.Exception> |
Futures.getChecked(java.util.concurrent.Future<V> future,
java.lang.Class<X> exceptionClass)
Returns the result of
Future.get() , converting most exceptions to a new instance of the
given checked exception type. |
static <V,X extends java.lang.Exception> |
Futures.getChecked(java.util.concurrent.Future<V> future,
java.lang.Class<X> exceptionClass,
java.time.Duration timeout)
Returns the result of
Future.get(long, TimeUnit) , converting most exceptions to a new
instance of the given checked exception type. |
(package private) static <V,X extends java.lang.Exception> |
FuturesGetChecked.getChecked(java.util.concurrent.Future<V> future,
java.lang.Class<X> exceptionClass,
long timeout,
java.util.concurrent.TimeUnit unit)
Implementation of
Futures.getChecked(Future, Class, long, TimeUnit) . |
static <V,X extends java.lang.Exception> |
Futures.getChecked(java.util.concurrent.Future<V> future,
java.lang.Class<X> exceptionClass,
long timeout,
java.util.concurrent.TimeUnit unit)
Returns the result of
Future.get(long, TimeUnit) , converting most exceptions to a new
instance of the given checked exception type. |
(package private) static <V,X extends java.lang.Exception> |
FuturesGetChecked.getChecked(FuturesGetChecked.GetCheckedTypeValidator validator,
java.util.concurrent.Future<V> future,
java.lang.Class<X> exceptionClass)
Implementation of
Futures.getChecked(Future, Class) . |
<D> D |
ClosingFuture.Peeker.getDone(ClosingFuture<D> closingFuture)
Returns the value of
closingFuture . |
static <V> V |
Futures.getDone(java.util.concurrent.Future<V> future)
Returns the result of the input
Future , which must have already completed. |
private V |
AbstractFuture.getDoneValue(java.lang.Object obj)
Unboxes
obj . |
static <V> V |
Futures.getUnchecked(java.util.concurrent.Future<V> future)
Returns the result of calling
Future.get() uninterruptibly on a task known not to throw
a checked exception. |
static <V> V |
Uninterruptibles.getUninterruptibly(java.util.concurrent.Future<V> future)
Invokes
future. get() uninterruptibly. |
private static <V> V |
AbstractFuture.getUninterruptibly(java.util.concurrent.Future<V> future)
An inlined private copy of
Uninterruptibles.getUninterruptibly(java.util.concurrent.Future<V>) used to break an
internal dependency on other /util/concurrent classes. |
static <V> V |
Uninterruptibles.getUninterruptibly(java.util.concurrent.Future<V> future,
java.time.Duration timeout)
Invokes
future. get(timeout, unit) uninterruptibly. |
static <V> V |
Uninterruptibles.getUninterruptibly(java.util.concurrent.Future<V> future,
long timeout,
java.util.concurrent.TimeUnit unit)
Invokes
future. get(timeout, unit) uninterruptibly. |
(package private) static <T> T |
MoreExecutors.invokeAnyImpl(ListeningExecutorService executorService,
java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks,
boolean timed,
java.time.Duration timeout)
An implementation of
ExecutorService.invokeAny(java.util.Collection<? extends java.util.concurrent.Callable<T>>) for ListeningExecutorService
implementations. |
(package private) static <T> T |
MoreExecutors.invokeAnyImpl(ListeningExecutorService executorService,
java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks,
boolean timed,
long timeout,
java.util.concurrent.TimeUnit unit)
An implementation of
ExecutorService.invokeAny(java.util.Collection<? extends java.util.concurrent.Callable<T>>) for ListeningExecutorService
implementations. |
(package private) V |
TrustedListenableFutureTask.TrustedFutureInterruptibleTask.runInterruptibly() |
(package private) abstract T |
InterruptibleTask.runInterruptibly()
Do interruptible work here - do not complete Futures here, as their listeners could be
interrupted.
|
(package private) V |
CombinedFuture.CallableInterruptibleTask.runInterruptibly() |
(package private) static <T> T |
NullnessCasts.uncheckedCastNullableTToT(T t)
Accepts a
@Nullable T and returns a plain T , without performing any check that
that conversion is safe. |
(package private) static <T> T |
NullnessCasts.uncheckedNull()
Returns
null cast to any type. |
Modifier and Type | Method and Description |
---|---|
(package private) abstract void |
InterruptibleTask.afterRanInterruptiblySuccess(T result)
Any interruption that happens as a result of calling interruptTask will arrive before this
method is called.
|
(package private) void |
CombinedFuture.CombinedFutureInterruptibleTask.afterRanInterruptiblySuccess(T result) |
(package private) void |
TrustedListenableFutureTask.TrustedFutureInterruptibleTask.afterRanInterruptiblySuccess(V result) |
U |
ClosingFuture.ClosingFunction.apply(ClosingFuture.DeferredCloser closer,
T input)
Applies this function to an input, or throws an exception if unable to do so.
|
ClosingFuture<U> |
ClosingFuture.AsyncClosingFunction.apply(ClosingFuture.DeferredCloser closer,
T input)
Applies this function to an input, or throws an exception if unable to do so.
|
U |
ClosingFuture.Combiner2.ClosingFunction2.apply(ClosingFuture.DeferredCloser closer,
V1 value1,
V2 value2)
Applies this function to two inputs, or throws an exception if unable to do so.
|
U |
ClosingFuture.Combiner2.ClosingFunction2.apply(ClosingFuture.DeferredCloser closer,
V1 value1,
V2 value2)
Applies this function to two inputs, or throws an exception if unable to do so.
|
ClosingFuture<U> |
ClosingFuture.Combiner2.AsyncClosingFunction2.apply(ClosingFuture.DeferredCloser closer,
V1 value1,
V2 value2)
Applies this function to two inputs, or throws an exception if unable to do so.
|
ClosingFuture<U> |
ClosingFuture.Combiner2.AsyncClosingFunction2.apply(ClosingFuture.DeferredCloser closer,
V1 value1,
V2 value2)
Applies this function to two inputs, or throws an exception if unable to do so.
|
U |
ClosingFuture.Combiner3.ClosingFunction3.apply(ClosingFuture.DeferredCloser closer,
V1 value1,
V2 value2,
V3 value3)
Applies this function to three inputs, or throws an exception if unable to do so.
|
U |
ClosingFuture.Combiner3.ClosingFunction3.apply(ClosingFuture.DeferredCloser closer,
V1 value1,
V2 value2,
V3 value3)
Applies this function to three inputs, or throws an exception if unable to do so.
|
U |
ClosingFuture.Combiner3.ClosingFunction3.apply(ClosingFuture.DeferredCloser closer,
V1 value1,
V2 value2,
V3 value3)
Applies this function to three inputs, or throws an exception if unable to do so.
|
ClosingFuture<U> |
ClosingFuture.Combiner3.AsyncClosingFunction3.apply(ClosingFuture.DeferredCloser closer,
V1 value1,
V2 value2,
V3 value3)
Applies this function to three inputs, or throws an exception if unable to do so.
|
ClosingFuture<U> |
ClosingFuture.Combiner3.AsyncClosingFunction3.apply(ClosingFuture.DeferredCloser closer,
V1 value1,
V2 value2,
V3 value3)
Applies this function to three inputs, or throws an exception if unable to do so.
|
ClosingFuture<U> |
ClosingFuture.Combiner3.AsyncClosingFunction3.apply(ClosingFuture.DeferredCloser closer,
V1 value1,
V2 value2,
V3 value3)
Applies this function to three inputs, or throws an exception if unable to do so.
|
U |
ClosingFuture.Combiner4.ClosingFunction4.apply(ClosingFuture.DeferredCloser closer,
V1 value1,
V2 value2,
V3 value3,
V4 value4)
Applies this function to four inputs, or throws an exception if unable to do so.
|
U |
ClosingFuture.Combiner4.ClosingFunction4.apply(ClosingFuture.DeferredCloser closer,
V1 value1,
V2 value2,
V3 value3,
V4 value4)
Applies this function to four inputs, or throws an exception if unable to do so.
|
U |
ClosingFuture.Combiner4.ClosingFunction4.apply(ClosingFuture.DeferredCloser closer,
V1 value1,
V2 value2,
V3 value3,
V4 value4)
Applies this function to four inputs, or throws an exception if unable to do so.
|
U |
ClosingFuture.Combiner4.ClosingFunction4.apply(ClosingFuture.DeferredCloser closer,
V1 value1,
V2 value2,
V3 value3,
V4 value4)
Applies this function to four inputs, or throws an exception if unable to do so.
|
ClosingFuture<U> |
ClosingFuture.Combiner4.AsyncClosingFunction4.apply(ClosingFuture.DeferredCloser closer,
V1 value1,
V2 value2,
V3 value3,
V4 value4)
Applies this function to four inputs, or throws an exception if unable to do so.
|
ClosingFuture<U> |
ClosingFuture.Combiner4.AsyncClosingFunction4.apply(ClosingFuture.DeferredCloser closer,
V1 value1,
V2 value2,
V3 value3,
V4 value4)
Applies this function to four inputs, or throws an exception if unable to do so.
|
ClosingFuture<U> |
ClosingFuture.Combiner4.AsyncClosingFunction4.apply(ClosingFuture.DeferredCloser closer,
V1 value1,
V2 value2,
V3 value3,
V4 value4)
Applies this function to four inputs, or throws an exception if unable to do so.
|
ClosingFuture<U> |
ClosingFuture.Combiner4.AsyncClosingFunction4.apply(ClosingFuture.DeferredCloser closer,
V1 value1,
V2 value2,
V3 value3,
V4 value4)
Applies this function to four inputs, or throws an exception if unable to do so.
|
U |
ClosingFuture.Combiner5.ClosingFunction5.apply(ClosingFuture.DeferredCloser closer,
V1 value1,
V2 value2,
V3 value3,
V4 value4,
V5 value5)
Applies this function to five inputs, or throws an exception if unable to do so.
|
U |
ClosingFuture.Combiner5.ClosingFunction5.apply(ClosingFuture.DeferredCloser closer,
V1 value1,
V2 value2,
V3 value3,
V4 value4,
V5 value5)
Applies this function to five inputs, or throws an exception if unable to do so.
|
U |
ClosingFuture.Combiner5.ClosingFunction5.apply(ClosingFuture.DeferredCloser closer,
V1 value1,
V2 value2,
V3 value3,
V4 value4,
V5 value5)
Applies this function to five inputs, or throws an exception if unable to do so.
|
U |
ClosingFuture.Combiner5.ClosingFunction5.apply(ClosingFuture.DeferredCloser closer,
V1 value1,
V2 value2,
V3 value3,
V4 value4,
V5 value5)
Applies this function to five inputs, or throws an exception if unable to do so.
|
U |
ClosingFuture.Combiner5.ClosingFunction5.apply(ClosingFuture.DeferredCloser closer,
V1 value1,
V2 value2,
V3 value3,
V4 value4,
V5 value5)
Applies this function to five inputs, or throws an exception if unable to do so.
|
ClosingFuture<U> |
ClosingFuture.Combiner5.AsyncClosingFunction5.apply(ClosingFuture.DeferredCloser closer,
V1 value1,
V2 value2,
V3 value3,
V4 value4,
V5 value5)
Applies this function to five inputs, or throws an exception if unable to do so.
|
ClosingFuture<U> |
ClosingFuture.Combiner5.AsyncClosingFunction5.apply(ClosingFuture.DeferredCloser closer,
V1 value1,
V2 value2,
V3 value3,
V4 value4,
V5 value5)
Applies this function to five inputs, or throws an exception if unable to do so.
|
ClosingFuture<U> |
ClosingFuture.Combiner5.AsyncClosingFunction5.apply(ClosingFuture.DeferredCloser closer,
V1 value1,
V2 value2,
V3 value3,
V4 value4,
V5 value5)
Applies this function to five inputs, or throws an exception if unable to do so.
|
ClosingFuture<U> |
ClosingFuture.Combiner5.AsyncClosingFunction5.apply(ClosingFuture.DeferredCloser closer,
V1 value1,
V2 value2,
V3 value3,
V4 value4,
V5 value5)
Applies this function to five inputs, or throws an exception if unable to do so.
|
ClosingFuture<U> |
ClosingFuture.Combiner5.AsyncClosingFunction5.apply(ClosingFuture.DeferredCloser closer,
V1 value1,
V2 value2,
V3 value3,
V4 value4,
V5 value5)
Applies this function to five inputs, or throws an exception if unable to do so.
|
ListenableFuture<O> |
AsyncFunction.apply(I input)
Returns an output
Future to use in place of the given input . |
(package private) <V,U> FluentFuture<U> |
ClosingFuture.CloseableList.applyAsyncClosingFunction(ClosingFuture.AsyncClosingFunction<V,U> transformation,
V input) |
(package private) <V,U> ListenableFuture<U> |
ClosingFuture.CloseableList.applyClosingFunction(ClosingFuture.ClosingFunction<? super V,U> transformation,
V input) |
(package private) abstract void |
AggregateFuture.collectOneValue(int index,
InputT returnValue)
If
allMustSucceed is true, called as each future completes; otherwise, if collectsValues is true, called for each future when all futures complete. |
(package private) void |
CollectionFuture.collectOneValue(int index,
V returnValue) |
(package private) static <V> TrustedListenableFutureTask<V> |
TrustedListenableFutureTask.create(java.lang.Runnable runnable,
V result)
Creates a
ListenableFutureTask that will upon running, execute the given Runnable , and arrange that get will return the given result on successful completion. |
static <V> ListenableFutureTask<V> |
ListenableFutureTask.create(java.lang.Runnable runnable,
V result)
Creates a
ListenableFutureTask that will upon running, execute the given Runnable , and arrange that get will return the given result on successful completion. |
(package private) ListenableFuture<? extends O> |
AbstractTransformFuture.AsyncTransformFuture.doTransform(AsyncFunction<? super I,? extends O> function,
I input) |
(package private) abstract T |
AbstractTransformFuture.doTransform(F function,
I result)
Template method for subtypes to actually run the transform.
|
(package private) O |
AbstractTransformFuture.TransformFuture.doTransform(Function<? super I,? extends O> function,
I input) |
<C extends java.lang.Object & java.lang.AutoCloseable> |
ClosingFuture.DeferredCloser.eventuallyClose(C closeable,
java.util.concurrent.Executor closingExecutor)
Captures an object to be closed when a
ClosingFuture pipeline is done. |
static <V> ListenableFuture<V> |
Futures.immediateFuture(V value)
Creates a
ListenableFuture which has its value set immediately upon construction. |
static <V> java.util.concurrent.atomic.AtomicReference<V> |
Atomics.newReference(V initialValue)
Creates an
AtomicReference instance with the given initial value. |
protected <T> java.util.concurrent.RunnableFuture<T> |
AbstractListeningExecutorService.newTaskFor(java.lang.Runnable runnable,
T value) |
void |
FutureCallback.onSuccess(V result)
Invoked with the result of the
Future computation when it is successful. |
static <T> java.util.concurrent.Callable<T> |
Callables.returning(T value)
Creates a
Callable which immediately returns a preset value each time it is called. |
boolean |
SettableFuture.set(V value) |
protected boolean |
AbstractFuture.set(V value)
Sets the result of this
Future unless this Future has already been cancelled or
set (including set asynchronously). |
(package private) void |
AbstractTransformFuture.TransformFuture.setResult(O result) |
(package private) abstract void |
AbstractTransformFuture.setResult(T result)
Template method for subtypes to actually set the result.
|
(package private) abstract void |
AbstractCatchingFuture.setResult(T result)
Template method for subtypes to actually set the result.
|
(package private) void |
AbstractCatchingFuture.CatchingFuture.setResult(V result) |
(package private) abstract void |
CombinedFuture.CombinedFutureInterruptibleTask.setValue(T value) |
(package private) void |
CombinedFuture.CallableInterruptibleTask.setValue(V value) |
<T> java.util.concurrent.Future<T> |
WrappingExecutorService.submit(java.lang.Runnable task,
T result) |
<T> ListenableFuture<T> |
ListeningExecutorService.submit(java.lang.Runnable task,
T result) |
<T> ListenableFuture<T> |
ForwardingListeningExecutorService.submit(java.lang.Runnable task,
T result) |
<T> java.util.concurrent.Future<T> |
ForwardingExecutorService.submit(java.lang.Runnable task,
T result) |
<T> ListenableFuture<T> |
AbstractListeningExecutorService.submit(java.lang.Runnable task,
T result) |
Constructor and Description |
---|
ImmediateFuture(V value) |
ListenableFutureTask(java.lang.Runnable runnable,
V result) |