public abstract class AbstractListenableFuture<V> extends Object implements ListenableFuture<V>
ListenableFuture.
Listener/Executor pairs are stored in the RunnableExecutorPair linked list in the order in which they were added, but because of thread scheduling issues there is
no guarantee that the JVM will execute them in order. In addition, listeners added after the task is complete will be executed immediately, even if some previously added
listeners have not yet been executed.ListenableFuture.CompletedFailure<T>| Constructor and Description |
|---|
AbstractListenableFuture() |
| Modifier and Type | Method and Description |
|---|---|
ListenableFuture<V> |
addListener(Runnable listener,
Executor exec)
Adds a listener and executor to the ListenableFuture.
|
protected void |
runListeners()
Execute the execution list.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitabort, done, toCompletableFuture, touchpublic ListenableFuture<V> addListener(Runnable listener, Executor exec)
ListenableFutureFuture's computation is
complete.
null, in that case executor will be executed
in the thread where completion happens.
addListener in interface ListenableFuture<V>listener - the listener to run when the computation is complete.exec - the executor to run the listener in.protected void runListeners()
Copyright © 2016. All Rights Reserved.