Package | Description |
---|---|
com.google.common.util.concurrent |
Concurrency utilities.
|
Modifier and Type | Interface and Description |
---|---|
interface |
ListeningScheduledExecutorService
A
ScheduledExecutorService that returns ListenableFuture
instances from its ExecutorService methods. |
Modifier and Type | Class and Description |
---|---|
class |
AbstractListeningExecutorService
Abstract
ListeningExecutorService implementation that creates
ListenableFutureTask instances for each Runnable and Callable submitted
to it. |
class |
ForwardingListeningExecutorService
A listening executor service which forwards all its method calls to another
listening executor service.
|
private static class |
MoreExecutors.DirectExecutorService |
private static class |
MoreExecutors.ListeningDecorator |
private static class |
MoreExecutors.ScheduledListeningDecorator |
Modifier and Type | Method and Description |
---|---|
protected abstract ListeningExecutorService |
ForwardingListeningExecutorService.delegate() |
static ListeningExecutorService |
MoreExecutors.listeningDecorator(java.util.concurrent.ExecutorService delegate)
Creates an
ExecutorService whose submit and invokeAll methods submit ListenableFutureTask instances to the
given delegate executor. |
static ListeningExecutorService |
MoreExecutors.newDirectExecutorService()
Creates an executor service that runs each task in the thread
that invokes
execute/submit , as in ThreadPoolExecutor.CallerRunsPolicy This
applies both to individually submitted tasks and to collections of tasks
submitted via invokeAll or invokeAny . |
static ListeningExecutorService |
MoreExecutors.sameThreadExecutor()
Deprecated.
Use
MoreExecutors.directExecutor() if you only require an Executor and
MoreExecutors.newDirectExecutorService() if you need a ListeningExecutorService . |
Modifier and Type | Method and Description |
---|---|
(package private) static <T> T |
MoreExecutors.invokeAnyImpl(ListeningExecutorService executorService,
java.util.Collection<? extends java.util.concurrent.Callable<T>> tasks,
boolean timed,
long nanos)
An implementation of
ExecutorService.invokeAny(java.util.Collection<? extends java.util.concurrent.Callable<T>>) for ListeningExecutorService
implementations. |
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. |