V
- Type of the value that will be returned.public interface ListenableFuture<V> extends Future<V>
Future
Modifier and Type | Interface and Description |
---|---|
static class |
ListenableFuture.CompletedFailure<T> |
Modifier and Type | Method and Description |
---|---|
void |
abort(Throwable t)
|
ListenableFuture<V> |
addListener(Runnable listener,
Executor exec)
Adds a listener and executor to the ListenableFuture.
|
void |
done()
Terminate and if there is no exception, mark this Future as done and release the internal lock.
|
CompletableFuture<V> |
toCompletableFuture() |
void |
touch()
Touch the current instance to prevent external service to times out.
|
void done()
void abort(Throwable t)
t
- the exceptionvoid touch()
ListenableFuture<V> addListener(Runnable listener, Executor exec)
Future
's computation is
complete.
null
, in that case executor will be executed
in the thread where completion happens.
listener
- the listener to run when the computation is complete.exec
- the executor to run the listener in.CompletableFuture<V> toCompletableFuture()
Copyright © 2017. All Rights Reserved.