CordaFuture
Keywords: net.corda.core.concurrent.CordaFuture interface
Date: 2023-09-18

net.corda.core.concurrent

## Interface CordaFuture<V>

-     public CordaFuture<V>

  Same as Future with additional methods to provide some of the features of java.util.concurrent.CompletableFuture while minimising the API surface area. In Kotlin, to avoid compile errors, whenever CordaFuture is used in a parameter or extension method receiver type, its type parameter should be specified with out variance.

  See Also:
    Future, java.util.concurrent.CompletableFuture

- - ### Constructor Detail

    - #### CordaFuture

          public CordaFuture()

  - ### Method Detail

    - #### then

          <W> void then(@NotNull
                        kotlin.jvm.functions.Function1<? super net.corda.core.concurrent.CordaFuture<V>,? extends W> callback)

      Run the given callback when this future is done, on the completion thread. If the completion thread is problematic for you e.g. deadlock, you can submit to an executor manually. If callback fails, its throwable is logged.

    - #### toCompletableFuture

          @NotNull
          java.util.concurrent.CompletableFuture<V> toCompletableFuture()

      Returns:
        a new CompletableFuture with the same outcome as this Future.