com.hazelcast.core

## Interface ICompletableFuture<V>

- Type Parameters:
    `V` -
  All Superinterfaces:
    Future<V>
  All Known Subinterfaces:
    DurableExecutorServiceFuture<V>, InternalCompletableFuture<E>, JobCompletableFuture<V>
  All Known Implementing Classes:
    com.hazelcast.spi.impl.AbstractCompletableFuture, ClientDelegatingFuture, CompletableFutureTask, CompletedFuture, DelegatingFuture, IExecutorDelegatingFuture

      public interface ICompletableFuture<V>
      extends Future<V>

  A Future where one can asynchronously listen on completion. This functionality is needed for the reactive programming model.

  For more information see: https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/CompletableFuture.html

  This class can be dropped once Hazelcast relies on Java8+. It is added to make Hazelcast compatible with Java6/7.

  Since:
    3.2

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `andThen(ExecutionCallback<V> callback)` Registers a callback that will run after this future is completed.
    `void` | `andThen(ExecutionCallback<V> callback, Executor executor)` Registers a callback that will run with the provided executor after this future is completed.

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

      `cancel, get, get, isCancelled, isDone`

- - ### Method Detail

    - #### andThen

          void andThen(ExecutionCallback<V> callback)

      Registers a callback that will run after this future is completed. If this future is already completed, it runs immediately.

      Please note that there is no ordering guarantee for running multiple callbacks. It is also not guaranteed that the callback will run within the same thread that completes the future.

      Parameters:
        `callback` - the callback to execute

    - #### andThen

          void andThen(ExecutionCallback<V> callback,
                       Executor executor)

      Registers a callback that will run with the provided executor after this future is completed. If this future is already completed, it runs immediately. The callback is called using the given `executor`. Please note that there is no ordering guarantee for executing multiple callbacks.
      Parameters:
        `callback` - the callback to execute
        `executor` - the executor in which the callback will be run

Copyright © 2020. All rights reserved.