V
- the result type of the async operationpublic interface ListenableFuture<V>
extends java.util.concurrent.Future<V>
Future
which adds the ability for callers to to register
callbacks when the async event completes.FutureListener
Modifier and Type | Method and Description |
---|---|
void |
addListener(FutureListener<V> listener)
Add a listener to this
Future which will be called when the async operation
completes. |
void |
removeListener(FutureListener<V> listener)
Remove a previously-registered listener from collection of listeners for this
Future . |
void addListener(FutureListener<V> listener)
Future
which will be called when the async operation
completes. If the async operation has already completed, the listener will be called
immediately.listener
- a FutureListener
implementation to call when the operation completesvoid removeListener(FutureListener<V> listener)
Future
. The listener will not be called which will be called when the async
operation completes. If listener
is not currently registered, this method is
a nop.listener
- a previously-registered FutureListener
implementation to remove from the
list of callback to call when the operation completes