Interface ListenableFuture<T,L extends GenericCompletionListener>

All Superinterfaces:
Future<T>
All Known Implementing Classes:
AbstractListenableFuture, BulkGetFuture, GetFuture, OperationFuture

public interface ListenableFuture<T,L extends GenericCompletionListener> extends Future<T>
A Future that accepts one or more listeners that will be executed asynchronously.
  • Method Details

    • addListener

      Future<T> addListener(L listener)
      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

      Future<T> removeListener(L listener)
      Remove a previously added listener from the future.
      Parameters:
      listener - the previously added listener.
      Returns:
      the current future to allow for object-chaining.