Package net.spy.memcached.internal
Interface ListenableFuture<T,L extends GenericCompletionListener>
- All Superinterfaces:
Future<T>
- All Known Implementing Classes:
AbstractListenableFuture
,BulkGetFuture
,GetFuture
,OperationFuture
A
Future
that accepts one or more listeners that will be executed
asynchronously.-
Nested Class Summary
Nested classes/interfaces inherited from interface java.util.concurrent.Future
Future.State
-
Method Summary
Modifier and TypeMethodDescriptionaddListener
(L listener) Add a listener to the future, which will be executed once the operation completes.removeListener
(L listener) Remove a previously added listener from the future.Methods inherited from interface java.util.concurrent.Future
cancel, exceptionNow, get, get, isCancelled, isDone, resultNow, state
-
Method Details
-
addListener
Add a listener to the future, which will be executed once the operation completes.- Parameters:
listener
- the listener which will be executed.- Returns:
- the current future to allow for object-chaining.
-
removeListener
Remove a previously added listener from the future.- Parameters:
listener
- the previously added listener.- Returns:
- the current future to allow for object-chaining.
-