Class CompletableFutures


  • public final class CompletableFutures
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <R> java.util.concurrent.CompletableFuture<R> computeAsync​(java.util.concurrent.Executor executor, java.util.function.Function<CancelChecker,​R> code)
      A utility method to create a CompletableFuture with cancellation support.
      static <R> java.util.concurrent.CompletableFuture<R> computeAsync​(java.util.function.Function<CancelChecker,​R> code)
      A utility method to create a CompletableFuture with cancellation support.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • computeAsync

        public static <R> java.util.concurrent.CompletableFuture<R> computeAsync​(java.util.function.Function<CancelChecker,​R> code)
        A utility method to create a CompletableFuture with cancellation support.
        Parameters:
        code - a function that accepts a CancelChecker and returns the to be computed value
        Returns:
        a future
      • computeAsync

        public static <R> java.util.concurrent.CompletableFuture<R> computeAsync​(java.util.concurrent.Executor executor,
                                                                                 java.util.function.Function<CancelChecker,​R> code)
        A utility method to create a CompletableFuture with cancellation support.
        Parameters:
        code - a function that accepts a CancelChecker and returns the to be computed value
        Returns:
        a future