@CheckReturnValue @ParametersAreNonnullByDefault
Package com.google.common.util.concurrent
Concurrency utilities.
Commonly used types include ListenableFuture and
Service.
Commonly used utilities include Futures, MoreExecutors, and ThreadFactoryBuilder.
This package is a part of the open-source Guava library.
-
Class Summary Class Description AbstractExecutionThreadService Base class for services that can implementAbstractExecutionThreadService.startUp(),AbstractExecutionThreadService.run()andAbstractExecutionThreadService.shutDown()methods.AbstractFuture<V> An abstract implementation ofListenableFuture, intended for advanced users only.AbstractIdleService Base class for services that do not need a thread while "running" but may need one during startup and shutdown.AbstractListeningExecutorService AbstractListeningExecutorServiceimplementation that createsListenableFutureinstances for eachRunnableandCallablesubmitted to it.AbstractScheduledService Base class for services that can implementAbstractScheduledService.startUp()andAbstractScheduledService.shutDown()but while in the "running" state need to perform a periodic task.AbstractScheduledService.CustomScheduler AAbstractScheduledService.Schedulerthat provides a convenient way for theAbstractScheduledServiceto use a dynamically changing schedule.AbstractScheduledService.CustomScheduler.Schedule A value object that represents an absolute delay until a task should be invoked.AbstractScheduledService.Scheduler A scheduler defines the policy for how theAbstractScheduledServiceshould run its task.AbstractService Base class for implementing services that can handleAbstractService.doStart()andAbstractService.doStop()requests, responding to them withAbstractService.notifyStarted()andAbstractService.notifyStopped()callbacks.AtomicDouble Adoublevalue that may be updated atomically.AtomicDoubleArray Adoublearray in which elements may be updated atomically.AtomicLongMap<K> A map containinglongvalues that can be atomically updated.Atomics Static utility methods pertaining to classes in thejava.util.concurrent.atomicpackage.Callables Static utility methods pertaining to theCallableinterface.ClosingFuture<V> A step in a pipeline of an asynchronous computation.ClosingFuture.Combiner A builder of aClosingFuturestep that is derived from more than one input step.ClosingFuture.Combiner2<V1 extends @Nullable Object,V2 extends @Nullable Object> A genericClosingFuture.Combinerthat lets you use a lambda or method reference to combine twoClosingFutures.ClosingFuture.Combiner3<V1 extends @Nullable Object,V2 extends @Nullable Object,V3 extends @Nullable Object> A genericClosingFuture.Combinerthat lets you use a lambda or method reference to combine threeClosingFutures.ClosingFuture.Combiner4<V1 extends @Nullable Object,V2 extends @Nullable Object,V3 extends @Nullable Object,V4 extends @Nullable Object> A genericClosingFuture.Combinerthat lets you use a lambda or method reference to combine fourClosingFutures.ClosingFuture.Combiner5<V1 extends @Nullable Object,V2 extends @Nullable Object,V3 extends @Nullable Object,V4 extends @Nullable Object,V5 extends @Nullable Object> A genericClosingFuture.Combinerthat lets you use a lambda or method reference to combine fiveClosingFutures.ClosingFuture.DeferredCloser An object that can capture objects to be closed later, when aClosingFuturepipeline is done.ClosingFuture.Peeker An object that can return the value of theClosingFutures that are passed toClosingFuture.whenAllComplete(Iterable)orClosingFuture.whenAllSucceed(Iterable).ClosingFuture.ValueAndCloser<V> An object that holds the final result of an asynchronousClosingFutureoperation and allows the user to close all the closeable objects that were captured during it for later closing.CycleDetectingLockFactory TheCycleDetectingLockFactorycreatesReentrantLockinstances andReentrantReadWriteLockinstances that detect potential deadlock by checking for cycles in lock acquisition order.CycleDetectingLockFactory.WithExplicitOrdering<E extends Enum<E>> ACycleDetectingLockFactory.WithExplicitOrderingprovides the additional enforcement of an application-specified ordering of lock acquisitions.ExecutionList A support class forListenableFutureimplementations to manage their listeners.ExecutionSequencer Serializes execution of tasks, somewhat like an "asynchronoussynchronizedblock." Each enqueued callable will not be submitted to its associated executor until the previous callable has returned -- and, if the previous callable was anAsyncCallable, not until theFutureit returned is done (successful, failed, or cancelled).FakeTimeLimiter A TimeLimiter implementation which actually does not attempt to limit time at all.FluentFuture<V> AListenableFuturethat supports fluent chains of operations.ForwardingBlockingDeque<E> ABlockingDequewhich forwards all its method calls to anotherBlockingDeque.ForwardingBlockingQueue<E> ABlockingQueuewhich forwards all its method calls to anotherBlockingQueue.ForwardingExecutorService An executor service which forwards all its method calls to another executor service.ForwardingFuture<V> AFuturewhich forwards all its method calls to another future.ForwardingFuture.SimpleForwardingFuture<V> A simplified version ofForwardingFuturewhere subclasses can pass in an already constructedFutureas the delegate.ForwardingListenableFuture<V> AListenableFuturewhich forwards all its method calls to another future.ForwardingListenableFuture.SimpleForwardingListenableFuture<V> A simplified version ofForwardingListenableFuturewhere subclasses can pass in an already constructedListenableFutureas the delegate.ForwardingListeningExecutorService A listening executor service which forwards all its method calls to another listening executor service.Futures Static utility methods pertaining to theFutureinterface.Futures.FutureCombiner<V> A helper to create a newListenableFuturewhose result is generated from a combination of input futures.JdkFutureAdapters Utilities necessary for working with libraries that supply plainFutureinstances.ListenableFutureTask<V> AFutureTaskthat also implements theListenableFutureinterface.Monitor A synchronization abstraction supporting waiting on arbitrary boolean conditions.Monitor.Guard A boolean condition for which a thread may wait.MoreExecutors RateLimiter A rate limiter.Runnables Static utility methods pertaining to theRunnableinterface.Service.Listener A listener for the various state changes that aServicegoes through in its lifecycle.ServiceManager A manager for monitoring and controlling a set of services.ServiceManager.Listener A listener for the aggregate state changes of the services that are under management.SettableFuture<V> AListenableFuturewhose result can be set by aSettableFuture.set(Object),SettableFuture.setException(Throwable)orSettableFuture.setFuture(ListenableFuture)call.SimpleTimeLimiter A TimeLimiter that runs method calls in the background using anExecutorService.Striped<L> A stripedLock/Semaphore/ReadWriteLock.ThreadFactoryBuilder A ThreadFactory builder, providing any combination of these features: whether threads should be marked as daemon threads a naming format a thread priority an uncaught exception handler a backing thread factoryUncaughtExceptionHandlers Factories forThread.UncaughtExceptionHandlerinstances.Uninterruptibles Utilities for treating interruptible operations as uninterruptible. -
Enum Summary Enum Description CycleDetectingLockFactory.Policies Pre-definedCycleDetectingLockFactory.Policyimplementations.Service.State The lifecycle states of a service. -
Exception Summary Exception Description CycleDetectingLockFactory.PotentialDeadlockException Represents a detected cycle in lock acquisition ordering.UncheckedExecutionException Unchecked variant ofExecutionException.UncheckedTimeoutException Unchecked version ofTimeoutException. -
Error Summary Error Description ExecutionError Errorvariant ofExecutionException.