Module dev.mccue.guava.concurrent
Package dev.mccue.guava.concurrent
@CheckReturnValue
@ParametersAreNonnullByDefault
package dev.mccue.guava.concurrent
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.
-
ClassDescriptionBase class for services that can implement
AbstractExecutionThreadService.startUp(),AbstractExecutionThreadService.run()andAbstractExecutionThreadService.shutDown()methods.AbstractFuture<V extends @Nullable Object>An abstract implementation ofListenableFuture, intended for advanced users only.Base class for services that do not need a thread while "running" but may need one during startup and shutdown.AbstractListeningExecutorServiceimplementation that createsListenableFutureinstances for eachRunnableandCallablesubmitted to it.Base class for services that can implementAbstractScheduledService.startUp()andAbstractScheduledService.shutDown()but while in the "running" state need to perform a periodic task.AAbstractScheduledService.Schedulerthat provides a convenient way for theAbstractScheduledServiceto use a dynamically changing schedule.A value object that represents an absolute delay until a task should be invoked.A scheduler defines the policy for how theAbstractScheduledServiceshould run its task.Base class for implementing services that can handleAbstractService.doStart()andAbstractService.doStop()requests, responding to them withAbstractService.notifyStarted()andAbstractService.notifyStopped()callbacks.AsyncCallable<V extends @Nullable Object>Computes a value, possibly asynchronously.Transforms a value, possibly asynchronously.Adoublevalue that may be updated atomically.Adoublearray in which elements may be updated atomically.A map containinglongvalues that can be atomically updated.Static utility methods pertaining to classes in thejava.util.concurrent.atomicpackage.Static utility methods pertaining to theCallableinterface.ClosingFuture<V extends @Nullable Object>A step in a pipeline of an asynchronous computation.ClosingFuture.AsyncClosingCallable<V extends @Nullable Object>An operation that computes aClosingFutureof a result.A function from an input to aClosingFutureof a result.ClosingFuture.ClosingCallable<V extends @Nullable Object>An operation that computes a result.A function from an input to a result.A builder of aClosingFuturestep that is derived from more than one input step.ClosingFuture.Combiner.AsyncCombiningCallable<V extends @Nullable Object>An operation that returns aClosingFutureresult and may throw an exception.ClosingFuture.Combiner.CombiningCallable<V extends @Nullable Object>An operation that returns a result and may throw an exception.A genericClosingFuture.Combinerthat lets you use a lambda or method reference to combine twoClosingFutures.ClosingFuture.Combiner2.AsyncClosingFunction2<V1 extends @Nullable Object,V2 extends @Nullable Object, U extends @Nullable Object> A function that returns aClosingFuturewhen applied to the values of the two futures passed toClosingFuture.whenAllSucceed(ClosingFuture, ClosingFuture).ClosingFuture.Combiner2.ClosingFunction2<V1 extends @Nullable Object,V2 extends @Nullable Object, U extends @Nullable Object> A function that returns a value when applied to the values of the two futures passed toClosingFuture.whenAllSucceed(ClosingFuture, ClosingFuture).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.Combiner3.AsyncClosingFunction3<V1 extends @Nullable Object,V2 extends @Nullable Object, V3 extends @Nullable Object, U extends @Nullable Object> A function that returns aClosingFuturewhen applied to the values of the three futures passed toClosingFuture.whenAllSucceed(ClosingFuture, ClosingFuture, ClosingFuture).ClosingFuture.Combiner3.ClosingFunction3<V1 extends @Nullable Object,V2 extends @Nullable Object, V3 extends @Nullable Object, U extends @Nullable Object> A function that returns a value when applied to the values of the three futures passed toClosingFuture.whenAllSucceed(ClosingFuture, ClosingFuture, ClosingFuture).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.Combiner4.AsyncClosingFunction4<V1 extends @Nullable Object,V2 extends @Nullable Object, V3 extends @Nullable Object, V4 extends @Nullable Object, U extends @Nullable Object> A function that returns aClosingFuturewhen applied to the values of the four futures passed toClosingFuture.whenAllSucceed(ClosingFuture, ClosingFuture, ClosingFuture, ClosingFuture).ClosingFuture.Combiner4.ClosingFunction4<V1 extends @Nullable Object,V2 extends @Nullable Object, V3 extends @Nullable Object, V4 extends @Nullable Object, U extends @Nullable Object> A function that returns a value when applied to the values of the four futures passed toClosingFuture.whenAllSucceed(ClosingFuture, ClosingFuture, ClosingFuture, ClosingFuture).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.Combiner5.AsyncClosingFunction5<V1 extends @Nullable Object,V2 extends @Nullable Object, V3 extends @Nullable Object, V4 extends @Nullable Object, V5 extends @Nullable Object, U extends @Nullable Object> A function that returns aClosingFuturewhen applied to the values of the five futures passed toClosingFuture.whenAllSucceed(ClosingFuture, ClosingFuture, ClosingFuture, ClosingFuture, ClosingFuture).ClosingFuture.Combiner5.ClosingFunction5<V1 extends @Nullable Object,V2 extends @Nullable Object, V3 extends @Nullable Object, V4 extends @Nullable Object, V5 extends @Nullable Object, U extends @Nullable Object> A function that returns a value when applied to the values of the five futures passed toClosingFuture.whenAllSucceed(ClosingFuture, ClosingFuture, ClosingFuture, ClosingFuture, ClosingFuture).An object that can capture objects to be closed later, when aClosingFuturepipeline is done.An object that can return the value of theClosingFutures that are passed toClosingFuture.whenAllComplete(Iterable)orClosingFuture.whenAllSucceed(Iterable).ClosingFuture.ValueAndCloser<V extends @Nullable Object>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.ClosingFuture.ValueAndCloserConsumer<V extends @Nullable Object>Represents an operation that accepts aClosingFuture.ValueAndCloserfor the last step in aClosingFuturepipeline.TheCycleDetectingLockFactorycreatesReentrantLockinstances andReentrantReadWriteLockinstances that detect potential deadlock by checking for cycles in lock acquisition order.Pre-definedCycleDetectingLockFactory.Policyimplementations.Encapsulates the action to be taken when a potential deadlock is encountered.Represents a detected cycle in lock acquisition ordering.CycleDetectingLockFactory.WithExplicitOrdering<E extends Enum<E>>ACycleDetectingLockFactory.WithExplicitOrderingprovides the additional enforcement of an application-specified ordering of lock acquisitions.Errorvariant ofExecutionException.A support class forListenableFutureimplementations to manage their listeners.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).A TimeLimiter implementation which actually does not attempt to limit time at all.FluentFuture<V extends @Nullable Object>AListenableFuturethat supports fluent chains of operations.ABlockingDequewhich forwards all its method calls to anotherBlockingDeque.ABlockingQueuewhich forwards all its method calls to anotherBlockingQueue.An executor service which forwards all its method calls to another executor service.ForwardingFuture<V extends @Nullable Object>AFuturewhich forwards all its method calls to another future.ForwardingFuture.SimpleForwardingFuture<V extends @Nullable Object>A simplified version ofForwardingFuturewhere subclasses can pass in an already constructedFutureas the delegate.ForwardingListenableFuture<V extends @Nullable Object>AListenableFuturewhich forwards all its method calls to another future.ForwardingListenableFuture.SimpleForwardingListenableFuture<V extends @Nullable Object>A simplified version ofForwardingListenableFuturewhere subclasses can pass in an already constructedListenableFutureas the delegate.A listening executor service which forwards all its method calls to another listening executor service.FutureCallback<V extends @Nullable Object>A callback for accepting the results of aFuturecomputation asynchronously.Static utility methods pertaining to theFutureinterface.Futures.FutureCombiner<V extends @Nullable Object>A helper to create a newListenableFuturewhose result is generated from a combination of input futures.Utilities necessary for working with libraries that supply plainFutureinstances.ListenableFuture<V extends @Nullable Object>AFuturethat accepts completion listeners.ListenableFutureTask<V extends @Nullable Object>AFutureTaskthat also implements theListenableFutureinterface.ListenableScheduledFuture<V extends @Nullable Object>Helper interface to implement bothListenableFutureandScheduledFuture.AnExecutorServicethat returnsListenableFutureinstances.AScheduledExecutorServicethat returnsListenableFutureinstances from itsExecutorServicemethods.A synchronization abstraction supporting waiting on arbitrary boolean conditions.A boolean condition for which a thread may wait.A rate limiter.Static utility methods pertaining to theRunnableinterface.An object with an operational state, plus asynchronousService.startAsync()andService.stopAsync()lifecycle methods to transition between states.A listener for the various state changes that aServicegoes through in its lifecycle.The lifecycle states of a service.A manager for monitoring and controlling a set of services.A listener for the aggregate state changes of the services that are under management.SettableFuture<V extends @Nullable Object>AListenableFuturewhose result can be set by aSettableFuture.set(Object),SettableFuture.setException(Throwable)orSettableFuture.setFuture(ListenableFuture)call.A TimeLimiter that runs method calls in the background using anExecutorService.Striped<L>A stripedLock/Semaphore/ReadWriteLock.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 factoryImposes a time limit on method calls.Factories forThread.UncaughtExceptionHandlerinstances.Unchecked variant ofExecutionException.Unchecked version ofTimeoutException.Utilities for treating interruptible operations as uninterruptible.