Top Description Interfaces Annotations Classes Enums
[default module]

Package com.google.common.util.concurrent

Annotations
@CheckReturnValue
@ParametersAreNonnullByDefault
Imports
com.google.errorprone.annotations.CheckReturnValue, javax.annotation.ParametersAreNonnullByDefault

Concurrency utilities.

Commonly used types include ClosingFuture, ListenableFuture, and Service.

Commonly used utilities include Futures, MoreExecutors, ThreadFactoryBuilder, and Uninterruptibles.

This package is a part of the open-source Guava library.

Interface Summary

Modifier and TypeInterface and Description
public interface
AsyncCallable<V extends @Nullable Object>

Computes a value, possibly asynchronously.

public interface
AsyncFunction<I extends @Nullable Object, O extends @Nullable Object>

Transforms a value, possibly asynchronously.

public interface
FutureCallback<V extends @Nullable Object>

A callback for accepting the results of a java.util.concurrent.Future computation asynchronously.

public interface
ListenableFuture<V extends @Nullable Object>

A Future that accepts completion listeners.

public interface
ListenableScheduledFuture<V extends @Nullable Object>

Helper interface to implement both ListenableFuture and ScheduledFuture.

public interface
public interface
ListeningScheduledExecutorService

A ScheduledExecutorService that returns ListenableFuture instances from its ExecutorService methods.

public interface
Service

An object with an operational state, plus asynchronous startAsync() and stopAsync() lifecycle methods to transition between states.

pack-priv interface
ServiceManagerBridge

Superinterface of ServiceManager to introduce a bridge method for servicesByState(), to ensure binary compatibility with older Guava versions that specified servicesByState() to return ImmutableMultimap.

public interface
TimeLimiter

Imposes a time limit on method calls.

Annotation Summary

Modifier and TypeAnnotation and Description
pack-priv @interface
ElementTypesAreNonnullByDefault

Marks all "top-level" types as non-null in a way that is recognized by Kotlin.

pack-priv @interface
ParametricNullness

Annotates a "top-level" type-variable usage that takes its nullness from the type argument supplied by the user of the class.

Class Summary

Modifier and TypeClass and Description
pack-priv abstract class
AbstractCatchingFuture<V extends @Nullable Object, X extends Throwable, F, T extends @Nullable Object>

Implementations of Futures.catching*.

public abstract class
AbstractExecutionThreadService

Base class for services that can implement startUp, run and shutDown methods.

public abstract class
AbstractFuture<V extends @Nullable Object>

An abstract implementation of ListenableFuture, intended for advanced users only.

public abstract class
AbstractIdleService

Base class for services that do not need a thread while "running" but may need one during startup and shutdown.

public abstract class
AbstractListeningExecutorService

Abstract ListeningExecutorService implementation that creates ListenableFuture instances for each Runnable and Callable submitted to it.

public abstract class
AbstractScheduledService

Base class for services that can implement startUp and shutDown but while in the "running" state need to perform a periodic task.

public abstract class
AbstractService

Base class for implementing services that can handle doStart and doStop requests, responding to them with notifyStarted() and notifyStopped() callbacks.

pack-priv abstract class
AbstractTransformFuture<I extends @Nullable Object, O extends @Nullable Object, F, T extends @Nullable Object>

Implementations of Futures.transform*.

pack-priv abstract class
AggregateFuture<
the type of the individual inputs
InputT extends @Nullable Object
,
the type of the output (i.e. this) future
OutputT extends @Nullable Object
>

A future whose value is derived from a collection of input futures.

pack-priv abstract class
AggregateFutureState<OutputT extends @Nullable Object>

A helper which does some thread-safe operations for aggregate futures, which must be implemented differently in GWT.

public class
AtomicDouble

A double value that may be updated atomically.

public class
AtomicDoubleArray

A double array in which elements may be updated atomically.

public class
AtomicLongMap<K>

A map containing long values that can be atomically updated.

public class
Atomics

Static utility methods pertaining to classes in the java.util.concurrent.atomic package.

public class
Callables

Static utility methods pertaining to the Callable interface.

public class
ClosingFuture<
the type of the value of this step
V extends @Nullable Object
>

A step in a pipeline of an asynchronous computation.

pack-priv abstract class
CollectionFuture<V extends @Nullable Object, C extends @Nullable Object>

Aggregate future that collects (stores) results of each future.

pack-priv class
CombinedFuture<V extends @Nullable Object>

Aggregate future that computes its value by calling a callable.

public class
CycleDetectingLockFactory

The CycleDetectingLockFactory creates ReentrantLock instances and ReentrantReadWriteLock instances that detect potential deadlock by checking for cycles in lock acquisition order.

public class
public class
ExecutionList

A support class for ListenableFuture implementations to manage their listeners.

public class
ExecutionSequencer

Serializes execution of tasks, somewhat like an "asynchronous synchronized block." Each enqueued callable will not be submitted to its associated executor until the previous callable has returned -- and, if the previous callable was an AsyncCallable, not until the Future it returned is done (successful, failed, or cancelled).

public class
FakeTimeLimiter

A TimeLimiter implementation which actually does not attempt to limit time at all.

public abstract class
FluentFuture<V extends @Nullable Object>

A ListenableFuture that supports fluent chains of operations.

public abstract class
ForwardingBlockingDeque<E>

A BlockingDeque which forwards all its method calls to another BlockingDeque.

public abstract class
ForwardingBlockingQueue<
the type of elements held in this collection
E
>

A BlockingQueue which forwards all its method calls to another BlockingQueue.

pack-priv abstract class
ForwardingCondition

Forwarding wrapper around a Condition.

public abstract class
ForwardingExecutorService

An executor service which forwards all its method calls to another executor service.

pack-priv class
ForwardingFluentFuture<V extends @Nullable Object>

FluentFuture that forwards all calls to a delegate.

public abstract class
ForwardingFuture<V extends @Nullable Object>

A Future which forwards all its method calls to another future.

public abstract class
ForwardingListenableFuture<V extends @Nullable Object>

A ListenableFuture which forwards all its method calls to another future.

public abstract class
ForwardingListeningExecutorService

A listening executor service which forwards all its method calls to another listening executor service.

pack-priv abstract class
ForwardingLock

Forwarding wrapper around a Lock.

public class
Futures

Static utility methods pertaining to the Future interface.

pack-priv class
FuturesGetChecked

Static methods used to implement Futures#getChecked(Future, Class).

pack-priv abstract class
GwtFluentFutureCatchingSpecialization<V extends @Nullable Object>

Hidden superclass of FluentFuture that provides us a place to declare special GWT versions of the FluentFuture.catching family of methods.

pack-priv abstract class
GwtFuturesCatchingSpecialization

Hidden superclass of Futures that provides us a place to declare special GWT versions of the Futures.catching family of methods.

pack-priv class
pack-priv class
Internal

This class is for com.google.common.util.concurrent use only!

pack-priv abstract class
public class
JdkFutureAdapters

Utilities necessary for working with libraries that supply plain Future instances.

pack-priv class
LazyLogger

A holder for a Logger that is initialized only when requested.

public class
ListenableFutureTask<V extends @Nullable Object>

A FutureTask that also implements the ListenableFuture interface.

pack-priv class
ListenerCallQueue<L>

A list of listeners for implementing a concurrency friendly observable object.

public class
Monitor

A synchronization abstraction supporting waiting on arbitrary boolean conditions.

public class
pack-priv class
NullnessCasts

A utility method to perform unchecked casts to suppress errors produced by nullness analyses.

pack-priv class
OverflowAvoidingLockSupport

Works around an android bug, where parking for more than INT_MAX seconds can produce an abort signal on 32 bit devices running Android Q.

pack-priv class
Partially

Outer class that exists solely to let us write Partially.GwtIncompatible instead of plain GwtIncompatible.

pack-priv class
Platform

Methods factored out so that they can be emulated differently in GWT.

public abstract class
RateLimiter

A rate limiter.

public class
Runnables

Static utility methods pertaining to the Runnable interface.

pack-priv class
SequentialExecutor

Executor ensuring that all Runnables submitted are executed in order, using the provided Executor, and sequentially such that no two will ever be running at the same time.

public class
ServiceManager

A manager for monitoring and controlling a set of services.

public class
public class
SimpleTimeLimiter

A TimeLimiter that runs method calls in the background using an ExecutorService.

pack-priv abstract class
public abstract class
Striped<L>

A striped Lock/Semaphore/ReadWriteLock.

public class
ThreadFactoryBuilder

A ThreadFactory builder, providing any combination of these features:

pack-priv class
TimeoutFuture<V extends @Nullable Object>

Implementation of Futures#withTimeout.

pack-priv class
TrustedListenableFutureTask<V extends @Nullable Object>

A RunnableFuture that also implements the ListenableFuture interface.

public class
public class
public class
public class
Uninterruptibles

Utilities for treating interruptible operations as uninterruptible.

pack-priv abstract class
WrappingExecutorService

An abstract ExecutorService that allows subclasses to wrap tasks before they are submitted to the underlying executor.

pack-priv abstract class
WrappingScheduledExecutorService

An abstract ScheduledExecutorService that allows subclasses to wrap tasks before they are submitted to the underlying executor.

Enum Summary

Modifier and TypeEnum and Description
pack-priv enum
DirectExecutor

An Executor that runs each task in the thread that invokes execute.