org.springframework.util.concurrent

## Interface ListenableFuture<T>

- All Superinterfaces:
    Future<T>
  All Known Implementing Classes:
    ListenableFutureAdapter, ListenableFutureTask

      public interface ListenableFuture<T>
      extends Future<T>

  Extends the `Future` interface with the capability to accept completion callbacks. If the future has already completed when the callback is added, the callback will be triggered immediately.

  Inspired by `com.google.common.util.concurrent.ListenableFuture`.

  Since:
    4.0
  Author:
    Arjen Poutsma

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addCallback(ListenableFutureCallback<? super T> callback)` Registers the given callback to this `ListenableFuture`.

    - ### Methods inherited from interface java.util.concurrent.Future

      `cancel, get, get, isCancelled, isDone`

- - ### Method Detail

    - #### addCallback

          void addCallback(ListenableFutureCallback<? super T> callback)

      Registers the given callback to this `ListenableFuture`. The callback will be triggered when this `Future` is complete or, if it is already complete, immediately.
      Parameters:
        `callback` - the callback to register