Class CompletableFutureUtils

java.lang.Object
io.foldright.cffu.CompletableFutureUtils

public final class CompletableFutureUtils extends Object
This class contains the new enhanced and backport methods for CompletableFuture.
Author:
Jerry Lee (oldratlee at gmail dot com), HuHao (995483610 at qq dot com)
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T> CompletableFuture<Void>
    acceptEitherSuccess(CompletableFuture<? extends T> cfThis, CompletionStage<? extends T> other, Consumer<? super T> action)
    Returns a new CompletableFuture that, when either given stage success, is executed with the corresponding result as argument to the supplied action.
    static <T> CompletableFuture<Void>
    acceptEitherSuccessAsync(CompletableFuture<? extends T> cfThis, CompletionStage<? extends T> other, Consumer<? super T> action)
    Returns a new CompletableFuture that, when either given stage success, is executed using this CompletableFuture's default asynchronous execution facility, with the corresponding result as argument to the supplied action.
    static <T> CompletableFuture<Void>
    acceptEitherSuccessAsync(CompletableFuture<? extends T> cfThis, CompletionStage<? extends T> other, Consumer<? super T> action, Executor executor)
    Returns a new CompletableFuture that, when either given stage success, is executed using the supplied executor, with the corresponding result as argument to the supplied action.
    Returns a new CompletableFuture that is successful when all the given stages success; If any of the given stages complete exceptionally, then the returned CompletableFuture also does so *without* waiting other incomplete given stages, with a CompletionException holding this exception as its cause.
    Returns a new CompletableFuture that is completed when all the given stages complete; If any of the given stages complete exceptionally, then the returned CompletableFuture also does so, with a CompletionException holding this exception as its cause.
    static <T> CompletableFuture<List<T>>
    Returns a new CompletableFuture that is successful with the results in the same order of the given stages arguments when all the given stages success; If any of the given stages complete exceptionally, then the returned CompletableFuture also does so *without* waiting other incomplete given stages, with a CompletionException holding this exception as its cause.
    static <T> CompletableFuture<List<T>>
    allResultsOf(CompletionStage<? extends T>... cfs)
    Returns a new CompletableFuture with the results in the same order of the given stages arguments, the new CompletableFuture is completed when all the given stages complete; If any of the given stages complete exceptionally, then the returned CompletableFuture also does so, with a CompletionException holding this exception as its cause.
    static <T> CompletableFuture<List<T>>
    allSuccessResultsOf(T valueIfFailed, CompletionStage<? extends T>... cfs)
    Returns a new CompletableFuture that is successful with the results in the same order of the given stages arguments when all the given stages completed; If the given stage complete exceptionally, treat it successful with value valueIfFailed.
    static <T1, T2> CompletableFuture<Tuple2<T1,T2>>
    allSuccessTupleOf(CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2)
    Returns a new CompletableFuture that is successful with the results of the given stages arguments when all the given stages completed; If the given stage complete exceptionally, treat it successful with value valueIfFailed.
    static <T1, T2, T3>
    CompletableFuture<Tuple3<T1,T2,T3>>
    allSuccessTupleOf(CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3)
    Returns a new CompletableFuture that is successful with the results of the given stages arguments when all the given stages completed; If the given stage complete exceptionally, treat it successful with value valueIfFailed.
    static <T1, T2, T3, T4>
    CompletableFuture<Tuple4<T1,T2,T3,T4>>
    allSuccessTupleOf(CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3, CompletionStage<? extends T4> cf4)
    Returns a new CompletableFuture that is successful with the results of the given stages arguments when all the given stages completed; If the given stage complete exceptionally, treat it successful with value valueIfFailed.
    static <T1, T2, T3, T4, T5>
    CompletableFuture<Tuple5<T1,T2,T3,T4,T5>>
    allSuccessTupleOf(CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3, CompletionStage<? extends T4> cf4, CompletionStage<? extends T5> cf5)
    Returns a new CompletableFuture that is successful with the results of the given stages arguments when all the given stages completed; If the given stage complete exceptionally, treat it successful with value valueIfFailed.
    static <T1, T2> CompletableFuture<Tuple2<T1,T2>>
    allTupleFastFailOf(CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2)
    Returns a new CompletableFuture that is successful when the given stages success.
    static <T1, T2, T3>
    CompletableFuture<Tuple3<T1,T2,T3>>
    allTupleFastFailOf(CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3)
    Returns a new CompletableFuture that is successful when the given stages success.
    static <T1, T2, T3, T4>
    CompletableFuture<Tuple4<T1,T2,T3,T4>>
    allTupleFastFailOf(CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3, CompletionStage<? extends T4> cf4)
    Returns a new CompletableFuture that is successful when the given stages success.
    static <T1, T2, T3, T4, T5>
    CompletableFuture<Tuple5<T1,T2,T3,T4,T5>>
    allTupleFastFailOf(CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3, CompletionStage<? extends T4> cf4, CompletionStage<? extends T5> cf5)
    Returns a new CompletableFuture that is successful when the given stages success.
    static <T1, T2> CompletableFuture<Tuple2<T1,T2>>
    allTupleOf(CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2)
    Returns a new CompletableFuture that is completed when the given stages complete.
    static <T1, T2, T3>
    CompletableFuture<Tuple3<T1,T2,T3>>
    allTupleOf(CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3)
    Returns a new CompletableFuture that is completed when the given stages complete.
    static <T1, T2, T3, T4>
    CompletableFuture<Tuple4<T1,T2,T3,T4>>
    allTupleOf(CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3, CompletionStage<? extends T4> cf4)
    Returns a new CompletableFuture that is completed when the given stages complete.
    static <T1, T2, T3, T4, T5>
    CompletableFuture<Tuple5<T1,T2,T3,T4,T5>>
    allTupleOf(CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3, CompletionStage<? extends T4> cf4, CompletionStage<? extends T5> cf5)
    Returns a new CompletableFuture that is completed when the given stages complete.
    static <T> CompletableFuture<T>
    anyOf(CompletionStage<? extends T>... cfs)
    Returns a new CompletableFuture that is completed when any of the given stages complete, with the same result.
    static <T> CompletableFuture<T>
    anySuccessOf(CompletionStage<? extends T>... cfs)
    Returns a new CompletableFuture that is successful when any of the given stages success, with the same result.
    static <T, U> CompletableFuture<U>
    applyToEitherSuccess(CompletableFuture<? extends T> cfThis, CompletionStage<? extends T> other, Function<? super T,? extends U> fn)
    Returns a new CompletableFuture that, when either given stage success, is executed with the corresponding result as argument to the supplied function.
    static <T, U> CompletableFuture<U>
    applyToEitherSuccessAsync(CompletableFuture<? extends T> cfThis, CompletionStage<? extends T> other, Function<? super T,? extends U> fn)
    Returns a new CompletableFuture that, when either given stage success, is executed using this CompletableFuture's default asynchronous execution facility, with the corresponding result as argument to the supplied function.
    static <T, U> CompletableFuture<U>
    applyToEitherSuccessAsync(CompletableFuture<? extends T> cfThis, CompletionStage<? extends T> other, Function<? super T,? extends U> fn, Executor executor)
    Returns a new CompletableFuture that, when either given stage success, is executed using the supplied executor, with the corresponding result as argument to the supplied function.
    static <T, X extends Throwable, C extends CompletionStage<? super T>>
    C
    catching(C cfThis, Class<X> exceptionType, Function<? super X,? extends T> fallback)
    Returns a new CompletionStage that, when given stage completes exceptionally with the given exceptionType, is executed with given stage's exception as the argument to the supplied function.
    static <T, X extends Throwable, C extends CompletionStage<? super T>>
    C
    catchingAsync(C cfThis, Class<X> exceptionType, Function<? super X,? extends T> fallback)
    Returns a new CompletionStage that, when given stage completes exceptionally with the given exceptionType, is executed with given stage's exception as the argument to the supplied function, using the given stage's default asynchronous execution facility.
    static <T, X extends Throwable, C extends CompletionStage<? super T>>
    C
    catchingAsync(C cfThis, Class<X> exceptionType, Function<? super X,? extends T> fallback, Executor executor)
    Returns a new CompletionStage that, when given stage completes exceptionally with the given exceptionType, is executed with given stage's exception as the argument to the supplied function, using the supplied Executor.
    static <T, X extends Throwable, C extends CompletionStage<? super T>>
    C
    catchingCompose(C cfThis, Class<X> exceptionType, Function<? super X,? extends CompletionStage<T>> fallback)
    Returns a new CompletionStage that, when given stage completes exceptionally with the given exceptionType, is composed using the results of the supplied function applied to given stage's exception.
    static <T, X extends Throwable, C extends CompletionStage<? super T>>
    C
    catchingComposeAsync(C cfThis, Class<X> exceptionType, Function<? super X,? extends CompletionStage<T>> fallback)
    Returns a new CompletionStage that, when given stage completes exceptionally with the given exceptionType, is composed using the results of the supplied function applied to given stage's exception, using given stage's default asynchronous execution facility.
    static <T, X extends Throwable, C extends CompletionStage<? super T>>
    C
    catchingComposeAsync(C cfThis, Class<X> exceptionType, Function<? super X,? extends CompletionStage<T>> fallback, Executor executor)
    Returns a new CompletionStage that, when given stage completes exceptionally with the given exceptionType, is composed using the results of the supplied function applied to given's exception, using the supplied Executor.
    static <T, C extends CompletableFuture<? super T>>
    C
    cffuCompleteOnTimeout(C cfThis, T value, long timeout, TimeUnit unit)
    Completes given CompletableFuture with the given value if not otherwise completed before the given timeout.
    static <T, C extends CompletableFuture<? super T>>
    C
    cffuCompleteOnTimeout(C cfThis, T value, Executor executorWhenTimeout, long timeout, TimeUnit unit)
    Completes given CompletableFuture with the given value if not otherwise completed before the given timeout.
    static <C extends CompletableFuture<?>>
    C
    cffuOrTimeout(C cfThis, long timeout, TimeUnit unit)
    Exceptionally completes given CompletableFuture with a TimeoutException if not otherwise completed before the given timeout.
    static <C extends CompletableFuture<?>>
    C
    cffuOrTimeout(C cfThis, Executor executorWhenTimeout, long timeout, TimeUnit unit)
    Exceptionally completes given CompletableFuture with a TimeoutException if not otherwise completed before the given timeout.
    static <T> CompletableFuture<T>[]
    A convenient util method for converting input CompletableFuture list to CompletableFuture array.
    static <T, C extends CompletableFuture<? super T>>
    C
    completeAsync(C cfThis, Supplier<? extends T> supplier)
    Completes given CompletableFuture with the result of the given Supplier function invoked from an asynchronous task using the default executor.
    static <T, C extends CompletableFuture<? super T>>
    C
    completeAsync(C cfThis, Supplier<? extends T> supplier, Executor executor)
    Completes given CompletableFuture with the result of the given Supplier function invoked from an asynchronous task using the given executor.
    static <T> CompletionStage<T>
    completedStage(T value)
    Returns a new CompletionStage that is already completed with the given value and supports only those methods in interface CompletionStage.
    static <C extends CompletableFuture<?>>
    C
    completeExceptionallyAsync(C cfThis, Supplier<? extends Throwable> supplier)
    If not already completed, completes given CompletableFuture with the exception result of the given Supplier function invoked from an asynchronous task using the default executor.
    static <C extends CompletableFuture<?>>
    C
    completeExceptionallyAsync(C cfThis, Supplier<? extends Throwable> supplier, Executor executor)
    If not already completed, completes given CompletableFuture with the exception result of the given Supplier function invoked from an asynchronous task using the given executor.
    static <T, C extends CompletableFuture<? super T>>
    C
    completeOnTimeout(C cfThis, T value, long timeout, TimeUnit unit)
    Completes given CompletableFuture with the given value if not otherwise completed before the given timeout.
    static <T> CompletableFuture<T>
    Returns a new CompletableFuture that is completed normally with the same value as this CompletableFuture when it completes normally.
    static Executor
    Returns the default Executor used for async methods that do not specify an Executor.
    static Executor
    delayedExecutor(long delay, TimeUnit unit)
    Returns a new Executor that submits a task to the default executor after the given delay (or no delay if non-positive).
    static Executor
    delayedExecutor(long delay, TimeUnit unit, Executor executor)
    Returns a new Executor that submits a task to the given base executor after the given delay (or no delay if non-positive).
    static <T, C extends CompletionStage<? super T>>
    C
    exceptionallyAsync(C cfThis, Function<Throwable,? extends T> fn)
    Returns a new CompletionStage that, when given stage completes exceptionally, is executed with given stage's exception as the argument to the supplied function, using given stage's default asynchronous execution facility.
    static <T, C extends CompletionStage<? super T>>
    C
    exceptionallyAsync(C cfThis, Function<Throwable,? extends T> fn, Executor executor)
    Returns a new CompletionStage that, when given stage completes exceptionally, is executed with given stage's exception as the argument to the supplied function, using the supplied Executor.
    static <T, C extends CompletionStage<? super T>>
    C
    Returns a new CompletableFuture that, when given CompletableFuture completes exceptionally, is composed using the results of the supplied function applied to given stage's exception.
    static <T, C extends CompletionStage<? super T>>
    C
    Returns a new CompletableFuture that, when given CompletableFuture completes exceptionally, is composed using the results of the supplied function applied to given stage's exception, using given CompletableFuture's default asynchronous execution facility.
    static <T, C extends CompletionStage<? super T>>
    C
    exceptionallyComposeAsync(C cfThis, Function<Throwable,? extends CompletionStage<T>> fn, Executor executor)
    Returns a new CompletableFuture that, when given CompletableFuture completes exceptionally, is composed using the results of the supplied function applied to given stage's exception, using the supplied Executor.
    static Throwable
    exceptionNow(Future<?> cfThis)
    Returns the exception thrown by the task, without waiting.
    static <T> CompletableFuture<T>
    Returns a new CompletableFuture that is already completed exceptionally with the given exception.
    static <T> CompletionStage<T>
    Returns a new CompletionStage that is already completed exceptionally with the given exception and supports only those methods in interface CompletionStage.
    static <T> T
    getSuccessNow(CompletableFuture<? extends T> cfThis, T valueIfNotSuccess)
    Returns the result value if the given stage is completed successfully, else returns the given valueIfNotSuccess.
    static <T> T
    join(CompletableFuture<T> cfThis, long timeout, TimeUnit unit)
    Waits if necessary for at most the given time for the computation to complete, and then retrieves its result value when complete, or throws an (unchecked) exception if completed exceptionally.
    static <T> CompletionStage<T>
    Returns a new CompletionStage that is completed normally with the same value as given CompletableFuture when it completes normally, and cannot be independently completed or otherwise used in ways not defined by the methods of interface CompletionStage.
    static <T> CompletableFuture<List<T>>
    mostSuccessResultsOf(T valueIfNotSuccess, long timeout, TimeUnit unit, CompletionStage<? extends T>... cfs)
    Returns a new CompletableFuture with the most results in the same order of the given stages arguments in the given time(timeout, aka as many results as possible in the given time).
    static <T> CompletableFuture<List<T>>
    mostSuccessResultsOf(T valueIfNotSuccess, Executor executorWhenTimeout, long timeout, TimeUnit unit, CompletionStage<? extends T>... cfs)
    Returns a new CompletableFuture with the most results in the same order of the given stages arguments in the given time(timeout, aka as many results as possible in the given time).
    static <T1, T2> CompletableFuture<Tuple2<T1,T2>>
    mostSuccessTupleOf(long timeout, TimeUnit unit, CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2)
    Returns a new CompletableFuture with the most results in the same order of the given stages arguments in the given time(timeout, aka as many results as possible in the given time).
    static <T1, T2, T3>
    CompletableFuture<Tuple3<T1,T2,T3>>
    mostSuccessTupleOf(long timeout, TimeUnit unit, CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3)
    Returns a new CompletableFuture with the most results in the same order of the given stages arguments in the given time(timeout, aka as many results as possible in the given time).
    static <T1, T2, T3, T4>
    CompletableFuture<Tuple4<T1,T2,T3,T4>>
    mostSuccessTupleOf(long timeout, TimeUnit unit, CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3, CompletionStage<? extends T4> cf4)
    Returns a new CompletableFuture with the most results in the same order of the given stages arguments in the given time(timeout, aka as many results as possible in the given time).
    static <T1, T2, T3, T4, T5>
    CompletableFuture<Tuple5<T1,T2,T3,T4,T5>>
    mostSuccessTupleOf(long timeout, TimeUnit unit, CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3, CompletionStage<? extends T4> cf4, CompletionStage<? extends T5> cf5)
    Returns a new CompletableFuture with the most results in the same order of the given stages arguments in the given time(timeout, aka as many results as possible in the given time).
    static <T1, T2> CompletableFuture<Tuple2<T1,T2>>
    mostSuccessTupleOf(Executor executorWhenTimeout, long timeout, TimeUnit unit, CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2)
    Returns a new CompletableFuture with the most results in the same order of the given stages arguments in the given time(timeout, aka as many results as possible in the given time).
    static <T1, T2, T3>
    CompletableFuture<Tuple3<T1,T2,T3>>
    mostSuccessTupleOf(Executor executorWhenTimeout, long timeout, TimeUnit unit, CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3)
    Returns a new CompletableFuture with the most results in the same order of the given stages arguments in the given time(timeout, aka as many results as possible in the given time).
    static <T1, T2, T3, T4>
    CompletableFuture<Tuple4<T1,T2,T3,T4>>
    mostSuccessTupleOf(Executor executorWhenTimeout, long timeout, TimeUnit unit, CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3, CompletionStage<? extends T4> cf4)
    Returns a new CompletableFuture with the most results in the same order of the given stages arguments in the given time(timeout, aka as many results as possible in the given time).
    static <T1, T2, T3, T4, T5>
    CompletableFuture<Tuple5<T1,T2,T3,T4,T5>>
    mostSuccessTupleOf(Executor executorWhenTimeout, long timeout, TimeUnit unit, CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3, CompletionStage<? extends T4> cf4, CompletionStage<? extends T5> cf5)
    Returns a new CompletableFuture with the most results in the same order of the given stages arguments in the given time(timeout, aka as many results as possible in the given time).
    mRunAnyAsync(Runnable... actions)
    Returns a new CompletableFuture that is asynchronously completed when any tasks running in the CompletableFuture's default asynchronous execution facility.
    mRunAnyAsync(Executor executor, Runnable... actions)
    Returns a new CompletableFuture that is asynchronously completed when any tasks running in the given executor complete.
    Returns a new CompletableFuture that is asynchronously successful when any tasks running in the CompletableFuture's default asynchronous execution facility success.
    mRunAnySuccessAsync(Executor executor, Runnable... actions)
    Returns a new CompletableFuture that is asynchronously successful when any tasks running in the given executor success.
    mRunAsync(Runnable... actions)
    Returns a new CompletableFuture that is asynchronously completed by tasks running in the CompletableFuture's default asynchronous execution facility after runs the given actions.
    mRunAsync(Executor executor, Runnable... actions)
    Returns a new CompletableFuture that is asynchronously completed by tasks running in the given Executor after runs the given actions.
    Returns a new CompletableFuture that is asynchronously completed by tasks running in the CompletableFuture's default asynchronous execution facility after runs the given actions.
    mRunFastFailAsync(Executor executor, Runnable... actions)
    Returns a new CompletableFuture that is asynchronously completed by tasks running in the given Executor after runs the given actions.
    static <T> CompletableFuture<List<T>>
    mSupplyAllSuccessAsync(T valueIfFailed, Executor executor, Supplier<? extends T>... suppliers)
    Returns a new CompletableFuture that is asynchronously completed by tasks running in the given Executor with the successfully values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
    static <T> CompletableFuture<List<T>>
    mSupplyAllSuccessAsync(T valueIfFailed, Supplier<? extends T>... suppliers)
    Returns a new CompletableFuture that is asynchronously completed by tasks running in the CompletableFuture's default asynchronous execution facility with the successful values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
    static <T> CompletableFuture<T>
    mSupplyAnyAsync(Executor executor, Supplier<? extends T>... suppliers)
    Returns a new CompletableFuture that is completed when any of tasks running in the given Executor by calling the given Suppliers complete, with the same result.
    static <T> CompletableFuture<T>
    mSupplyAnyAsync(Supplier<? extends T>... suppliers)
    Returns a new CompletableFuture that is completed when any of tasks running in the CompletableFuture's default asynchronous execution facility by calling the given Suppliers complete, with the same result.
    static <T> CompletableFuture<T>
    mSupplyAnySuccessAsync(Executor executor, Supplier<? extends T>... suppliers)
    Returns a new CompletableFuture that is asynchronously successful when any of tasks running in the given executor by calling the given Suppliers success, with the same result.
    static <T> CompletableFuture<T>
    mSupplyAnySuccessAsync(Supplier<? extends T>... suppliers)
    Returns a new CompletableFuture that is asynchronously successful when any of tasks running in the CompletableFuture's default asynchronous execution facility by calling the given Suppliers success, with the same result.
    static <T> CompletableFuture<List<T>>
    mSupplyAsync(Executor executor, Supplier<? extends T>... suppliers)
    Returns a new CompletableFuture that is asynchronously completed by tasks running in the given Executor with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
    static <T> CompletableFuture<List<T>>
    mSupplyAsync(Supplier<? extends T>... suppliers)
    Returns a new CompletableFuture that is asynchronously completed by tasks running in the CompletableFuture's default asynchronous execution facility with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
    static <T> CompletableFuture<List<T>>
    mSupplyFastFailAsync(Executor executor, Supplier<? extends T>... suppliers)
    Returns a new CompletableFuture that is asynchronously completed by tasks running in the given Executor with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
    static <T> CompletableFuture<List<T>>
    mSupplyFastFailAsync(Supplier<? extends T>... suppliers)
    Returns a new CompletableFuture that is asynchronously completed by tasks running in the CompletableFuture's default asynchronous execution facility with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
    static <T> CompletableFuture<List<T>>
    mSupplyMostSuccessAsync(T valueIfNotSuccess, long timeout, TimeUnit unit, Supplier<? extends T>... suppliers)
    Returns a new CompletableFuture that is asynchronously completed by tasks running in the CompletableFuture's default asynchronous execution facility with the most values obtained by calling the given Suppliers in the given time(timeout, aka as many results as possible in the given time) in the same order of the given Suppliers arguments.
    static <T> CompletableFuture<List<T>>
    mSupplyMostSuccessAsync(T valueIfNotSuccess, Executor executor, long timeout, TimeUnit unit, Supplier<? extends T>... suppliers)
    Returns a new CompletableFuture that is asynchronously completed by tasks running in the given Executor with the most values obtained by calling the given Suppliers in the given time(timeout, aka as many results as possible in the given time) in the same order of the given Suppliers arguments.
    static <U> CompletableFuture<U>
    Returns a new incomplete CompletableFuture of the type to be returned by a CompletionStage method.
    static <C extends CompletableFuture<?>>
    C
    orTimeout(C cfThis, long timeout, TimeUnit unit)
    Exceptionally completes given CompletableFuture with a TimeoutException if not otherwise completed before the given timeout.
    static <T, C extends CompletionStage<? extends T>>
    C
    peek(C cfThis, BiConsumer<? super T,? super Throwable> action)
    Peeks the result by executing the given action when given stage completes, returns the given stage.
    static <T, C extends CompletionStage<? extends T>>
    C
    peekAsync(C cfThis, BiConsumer<? super T,? super Throwable> action)
    Peeks the result by executing the given action when given stage completes, executes the given action using given stage's default asynchronous execution facility, returns the given stage.
    static <T, C extends CompletionStage<? extends T>>
    C
    peekAsync(C cfThis, BiConsumer<? super T,? super Throwable> action, Executor executor)
    Peeks the result by executing the given action when given stage completes, executes the given action using the supplied Executor, returns the given stage.
    static <T> T
    resultNow(Future<T> cfThis)
    Returns the computed result, without waiting.
    Returns a new CompletableFuture that, when two given stages both complete normally, executes the given action.
    Returns a new CompletableFuture that, when two given stages both complete normally, executes the given action using CompletableFuture's default asynchronous execution facility.
    Returns a new CompletableFuture that, when two given stages both complete normally, executes the given action using the supplied executor.
    Returns a new CompletableFuture that, when either given stage success, executes the given action.
    Returns a new CompletableFuture that, when either given stage success, executes the given action using CompletableFuture's default asynchronous execution facility.
    Returns a new CompletableFuture that, when either given stage success, executes the given action using the supplied executor.
    static CffuState
    state(Future<?> cfThis)
    Returns the computation state(CffuState), this method is equivalent to CompletableFuture.state() with java version compatibility logic, so you can invoke in old java 18-.
    static <T, U> CompletableFuture<Void>
    thenAcceptBothFastFail(CompletableFuture<? extends T> cfThis, CompletionStage<? extends U> other, BiConsumer<? super T,? super U> action)
    Returns a new CompletableFuture that, when tow given stage both complete normally, is executed with the two results as arguments to the supplied action.
    static <T, U> CompletableFuture<Void>
    thenAcceptBothFastFailAsync(CompletableFuture<? extends T> cfThis, CompletionStage<? extends U> other, BiConsumer<? super T,? super U> action)
    Returns a new CompletableFuture that, when tow given stage both complete normally, is executed using CompletableFuture's default asynchronous execution facility, with the two results as arguments to the supplied action.
    static <T, U> CompletableFuture<Void>
    thenAcceptBothFastFailAsync(CompletableFuture<? extends T> cfThis, CompletionStage<? extends U> other, BiConsumer<? super T,? super U> action, Executor executor)
    Returns a new CompletableFuture that, when tow given stage both complete normally, is executed using the supplied executor, with the two results as arguments to the supplied action.
    static <T, U, V> CompletableFuture<V>
    thenCombineFastFail(CompletableFuture<? extends T> cfThis, CompletionStage<? extends U> other, BiFunction<? super T,? super U,? extends V> fn)
    Returns a new CompletableFuture that, when tow given stage both complete normally, is executed with the two results as arguments to the supplied function.
    static <T, U, V> CompletableFuture<V>
    thenCombineFastFailAsync(CompletableFuture<? extends T> cfThis, CompletionStage<? extends U> other, BiFunction<? super T,? super U,? extends V> fn)
    Returns a new CompletableFuture that, when tow given stage both complete normally, is executed using CompletableFuture's default asynchronous execution facility, with the two results as arguments to the supplied function.
    static <T, U, V> CompletableFuture<V>
    thenCombineFastFailAsync(CompletableFuture<? extends T> cfThis, CompletionStage<? extends U> other, BiFunction<? super T,? super U,? extends V> fn, Executor executor)
    Returns a new CompletableFuture that, when tow given stage both complete normally, is executed using the supplied executor, with the two results as arguments to the supplied function.
    static <T> CompletableFuture<Void>
    thenMAcceptAnyAsync(CompletableFuture<? extends T> cfThis, Executor executor, Consumer<? super T>... actions)
    Returns a new CompletableFuture that, when the given stage completes normally, is executed using the given Executor, with the given stage's result as the argument to the given actions.
    static <T> CompletableFuture<Void>
    thenMAcceptAnyAsync(CompletableFuture<? extends T> cfThis, Consumer<? super T>... actions)
    Returns a new CompletableFuture that, when the given stage completes normally, is executed using the CompletableFuture's default asynchronous execution facility, with the given stage's result as the argument to the given actions.
    static <T> CompletableFuture<Void>
    thenMAcceptAnySuccessAsync(CompletableFuture<? extends T> cfThis, Executor executor, Consumer<? super T>... actions)
    Returns a new CompletableFuture that, when the given stage completes normally, is executed using the given Executor, with the given stage's result as the argument to the given actions.
    static <T> CompletableFuture<Void>
    thenMAcceptAnySuccessAsync(CompletableFuture<? extends T> cfThis, Consumer<? super T>... actions)
    Returns a new CompletableFuture that, when the given stage completes normally, is executed using the CompletableFuture's default asynchronous execution facility, with the given stage's result as the argument to the given actions.
    static <T> CompletableFuture<Void>
    thenMAcceptAsync(CompletableFuture<? extends T> cfThis, Executor executor, Consumer<? super T>... actions)
    Returns a new CompletableFuture that, when the given stage completes normally, is executed using the given Executor, with the given stage's result as the argument to the given actions.
    static <T> CompletableFuture<Void>
    thenMAcceptAsync(CompletableFuture<? extends T> cfThis, Consumer<? super T>... actions)
    Returns a new CompletableFuture that, when the given stage completes normally, is executed using the CompletableFuture's default asynchronous execution facility, with the given stage's result as the argument to the given actions.
    static <T> CompletableFuture<Void>
    thenMAcceptFastFailAsync(CompletableFuture<? extends T> cfThis, Executor executor, Consumer<? super T>... actions)
    Returns a new CompletableFuture that, when the given stage completes normally, is executed using the given Executor, with the given stage's result as the argument to the given actions.
    static <T> CompletableFuture<Void>
    thenMAcceptFastFailAsync(CompletableFuture<? extends T> cfThis, Consumer<? super T>... actions)
    Returns a new CompletableFuture that, when the given stage completes normally, is executed using the CompletableFuture's default asynchronous execution facility, with the given stage's result as the argument to the given actions.
    static <T, U> CompletableFuture<List<U>>
    thenMApplyAllSuccessAsync(CompletableFuture<? extends T> cfThis, U valueIfFailed, Executor executor, Function<? super T,? extends U>... fns)
    Returns a new CompletableFuture that, when the given stage completes normally, is executed in the given Executor with the successful values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the same order of the given Functions arguments.
    static <T, U> CompletableFuture<List<U>>
    thenMApplyAllSuccessAsync(CompletableFuture<? extends T> cfThis, U valueIfFailed, Function<? super T,? extends U>... fns)
    Returns a new CompletableFuture that, when the given stage completes normally, is executed in the CompletableFuture's default asynchronous execution facility with the successful values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the same order of the given Functions arguments.
    static <T, U> CompletableFuture<U>
    thenMApplyAnyAsync(CompletableFuture<? extends T> cfThis, Executor executor, Function<? super T,? extends U>... fns)
    Returns a new CompletableFuture that, when the given stage completes normally, is executed using the given Executor, with any completed result obtained by calling the given Functions (with the given stage's result as the argument to the given functions).
    static <T, U> CompletableFuture<U>
    thenMApplyAnyAsync(CompletableFuture<? extends T> cfThis, Function<? super T,? extends U>... fns)
    Returns a new CompletableFuture that, when the given stage completes normally, is executed using the CompletableFuture's default asynchronous execution facility, with any completed result obtained by calling the given Functions (with the given stage's result as the argument to the given functions).
    static <T, U> CompletableFuture<U>
    thenMApplyAnySuccessAsync(CompletableFuture<? extends T> cfThis, Executor executor, Function<? super T,? extends U>... fns)
    Returns a new CompletableFuture that, when the given stage completes normally, is executed using the given Executor, with any successful value obtained by calling the given Functions (with the given stage's result as the argument to the given functions).
    static <T, U> CompletableFuture<U>
    thenMApplyAnySuccessAsync(CompletableFuture<? extends T> cfThis, Function<? super T,? extends U>... fns)
    Returns a new CompletableFuture that, when the given stage completes normally, is executed using the CompletableFuture's default asynchronous execution facility, with any successful value obtained by calling the given Functions (with the given stage's result as the argument to the given functions).
    static <T, U> CompletableFuture<List<U>>
    thenMApplyAsync(CompletableFuture<? extends T> cfThis, Executor executor, Function<? super T,? extends U>... fns)
    Returns a new CompletableFuture that, when the given stage completes normally, is executed using the given Executor, with the values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the same order of the given Functions arguments.
    static <T, U> CompletableFuture<List<U>>
    thenMApplyAsync(CompletableFuture<? extends T> cfThis, Function<? super T,? extends U>... fns)
    Returns a new CompletableFuture that, when the given stage completes normally, is executed using the CompletableFuture's default asynchronous execution facility, with the values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the same order of the given Functions arguments.
    static <T, U> CompletableFuture<List<U>>
    thenMApplyFastFailAsync(CompletableFuture<? extends T> cfThis, Executor executor, Function<? super T,? extends U>... fns)
    Returns a new CompletableFuture that, when the given stage completes normally, is executed using the given Executor, with the values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the same order of the given Functions arguments.
    static <T, U> CompletableFuture<List<U>>
    thenMApplyFastFailAsync(CompletableFuture<? extends T> cfThis, Function<? super T,? extends U>... fns)
    Returns a new CompletableFuture that, when the given stage completes normally, is executed using the CompletableFuture's default asynchronous execution facility, with the values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the same order of the given Functions arguments.
    static <T, U> CompletableFuture<List<U>>
    thenMApplyMostSuccessAsync(CompletableFuture<? extends T> cfThis, U valueIfNotSuccess, long timeout, TimeUnit unit, Function<? super T,? extends U>... fns)
    Returns a new CompletableFuture that, when the given stage completes normally, is executed using the CompletableFuture's default asynchronous execution facility, with the most values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the given time(timeout, aka as many results as possible in the given time) in the same order of the given Functions arguments.
    static <T, U> CompletableFuture<List<U>>
    thenMApplyMostSuccessAsync(CompletableFuture<? extends T> cfThis, U valueIfNotSuccess, Executor executor, long timeout, TimeUnit unit, Function<? super T,? extends U>... fns)
    Returns a new CompletableFuture that, when the given stage completes normally, is executed using the given Executor, with the most values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the given time(timeout, aka as many results as possible in the given time) in the same order of the given Functions arguments.
    Returns a new CompletableFuture that, when the given stage completes normally, executes the given actions using the CompletableFuture's default asynchronous execution facility.
    thenMRunAnyAsync(CompletableFuture<?> cfThis, Executor executor, Runnable... actions)
    Returns a new CompletableFuture that, when the given stage completes normally, executes the given actions using the given Executor.
    Returns a new CompletableFuture that, when the given stage completes normally, executes the given actions using the CompletableFuture's default asynchronous execution facility.
    thenMRunAnySuccessAsync(CompletableFuture<?> cfThis, Executor executor, Runnable... actions)
    Returns a new CompletableFuture that, when the given stage completes normally, executes the given actions using the given Executor.
    thenMRunAsync(CompletableFuture<?> cfThis, Runnable... actions)
    Returns a new CompletableFuture that, when the given stage completes normally, executes the given actions using the CompletableFuture's default asynchronous execution facility.
    thenMRunAsync(CompletableFuture<?> cfThis, Executor executor, Runnable... actions)
    Returns a new CompletableFuture that, when the given stage completes normally, executes the given actions using the given Executor.
    Returns a new CompletableFuture that, when the given stage completes normally, executes the given actions using the CompletableFuture's default asynchronous execution facility.
    thenMRunFastFailAsync(CompletableFuture<?> cfThis, Executor executor, Runnable... actions)
    Returns a new CompletableFuture that, when the given stage completes normally, executes the given actions using the given Executor.
    static <T, U1, U2>
    CompletableFuture<Tuple2<U1,U2>>
    thenTupleMApplyAllSuccessAsync(CompletableFuture<? extends T> cfThis, Executor executor, Function<? super T,? extends U1> fn1, Function<? super T,? extends U2> fn2)
    Returns a new CompletableFuture that, when the given stage completes normally, is executed in the given Executor with the successful values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the same order of the given Functions arguments.
    static <T, U1, U2, U3>
    CompletableFuture<Tuple3<U1,U2,U3>>
    thenTupleMApplyAllSuccessAsync(CompletableFuture<? extends T> cfThis, Executor executor, Function<? super T,? extends U1> fn1, Function<? super T,? extends U2> fn2, Function<? super T,? extends U3> fn3)
    Returns a new CompletableFuture that, when the given stage completes normally, is executed in the given Executor with the successful values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the same order of the given Functions arguments.
    static <T, U1, U2, U3, U4>
    CompletableFuture<Tuple4<U1,U2,U3,U4>>
    thenTupleMApplyAllSuccessAsync(CompletableFuture<? extends T> cfThis, Executor executor, Function<? super T,? extends U1> fn1, Function<? super T,? extends U2> fn2, Function<? super T,? extends U3> fn3, Function<? super T,? extends U4> fn4)
    Returns a new CompletableFuture that, when the given stage completes normally, is executed in the given Executor with the successful values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the same order of the given Functions arguments.
    static <T, U1, U2, U3, U4, U5>
    CompletableFuture<Tuple5<U1,U2,U3,U4,U5>>
    thenTupleMApplyAllSuccessAsync(CompletableFuture<? extends T> cfThis, Executor executor, Function<? super T,? extends U1> fn1, Function<? super T,? extends U2> fn2, Function<? super T,? extends U3> fn3, Function<? super T,? extends U4> fn4, Function<? super T,? extends U5> fn5)
    Returns a new CompletableFuture that, when the given stage completes normally, is executed in the given Executor with the successful values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the same order of the given Functions arguments.
    static <T, U1, U2>
    CompletableFuture<Tuple2<U1,U2>>
    thenTupleMApplyAllSuccessAsync(CompletableFuture<? extends T> cfThis, Function<? super T,? extends U1> fn1, Function<? super T,? extends U2> fn2)
    Returns a new CompletableFuture that, when the given stage completes normally, is executed in the CompletableFuture's default asynchronous execution facility with the successful values obtained by calling the given Functions (with the given stage's result as the argument to the given functions).
    static <T, U1, U2, U3>
    CompletableFuture<Tuple3<U1,U2,U3>>
    thenTupleMApplyAllSuccessAsync(CompletableFuture<? extends T> cfThis, Function<? super T,? extends U1> fn1, Function<? super T,? extends U2> fn2, Function<? super T,? extends U3> fn3)
    Returns a new CompletableFuture that, when the given stage completes normally, is executed in the CompletableFuture's default asynchronous execution facility with the successful values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the same order of the given Functions arguments.
    static <T, U1, U2, U3, U4>
    CompletableFuture<Tuple4<U1,U2,U3,U4>>
    thenTupleMApplyAllSuccessAsync(CompletableFuture<? extends T> cfThis, Function<? super T,? extends U1> fn1, Function<? super T,? extends U2> fn2, Function<? super T,? extends U3> fn3, Function<? super T,? extends U4> fn4)
    Returns a new CompletableFuture that, when the given stage completes normally, is executed in the CompletableFuture's default asynchronous execution facility with the successful values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the same order of the given Functions arguments.
    static <T, U1, U2, U3, U4, U5>
    CompletableFuture<Tuple5<U1,U2,U3,U4,U5>>
    thenTupleMApplyAllSuccessAsync(CompletableFuture<? extends T> cfThis, Function<? super T,? extends U1> fn1, Function<? super T,? extends U2> fn2, Function<? super T,? extends U3> fn3, Function<? super T,? extends U4> fn4, Function<? super T,? extends U5> fn5)
    Returns a new CompletableFuture that, when the given stage completes normally, is executed in the CompletableFuture's default asynchronous execution facility with the successful values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the same order of the given Functions arguments.
    static <T, U1, U2>
    CompletableFuture<Tuple2<U1,U2>>
    thenTupleMApplyAsync(CompletableFuture<? extends T> cfThis, Executor executor, Function<? super T,? extends U1> fn1, Function<? super T,? extends U2> fn2)
    Returns a new CompletableFuture that, when the given stage completes normally, is executed using the given Executor, with the values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the same order of the given Functions arguments.
    static <T, U1, U2, U3>
    CompletableFuture<Tuple3<U1,U2,U3>>
    thenTupleMApplyAsync(CompletableFuture<? extends T> cfThis, Executor executor, Function<? super T,? extends U1> fn1, Function<? super T,? extends U2> fn2, Function<? super T,? extends U3> fn3)
    Returns a new CompletableFuture that, when the given stage completes normally, is executed using the given Executor, with the values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the same order of the given Functions arguments.
    static <T, U1, U2, U3, U4>
    CompletableFuture<Tuple4<U1,U2,U3,U4>>
    thenTupleMApplyAsync(CompletableFuture<? extends T> cfThis, Executor executor, Function<? super T,? extends U1> fn1, Function<? super T,? extends U2> fn2, Function<? super T,? extends U3> fn3, Function<? super T,? extends U4> fn4)
    Returns a new CompletableFuture that, when the given stage completes normally, is executed using the given Executor, with the values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the same order of the given Functions arguments.
    static <T, U1, U2, U3, U4, U5>
    CompletableFuture<Tuple5<U1,U2,U3,U4,U5>>
    thenTupleMApplyAsync(CompletableFuture<? extends T> cfThis, Executor executor, Function<? super T,? extends U1> fn1, Function<? super T,? extends U2> fn2, Function<? super T,? extends U3> fn3, Function<? super T,? extends U4> fn4, Function<? super T,? extends U5> fn5)
    Returns a new CompletableFuture that, when the given stage completes normally, is executed using the given Executor, with the values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the same order of the given Functions arguments.
    static <T, U1, U2>
    CompletableFuture<Tuple2<U1,U2>>
    thenTupleMApplyAsync(CompletableFuture<? extends T> cfThis, Function<? super T,? extends U1> fn1, Function<? super T,? extends U2> fn2)
    Returns a new CompletableFuture that, when the given stage completes normally, is executed using the CompletableFuture's default asynchronous execution facility, with the values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the same order of the given Functions arguments.
    static <T, U1, U2, U3>
    CompletableFuture<Tuple3<U1,U2,U3>>
    thenTupleMApplyAsync(CompletableFuture<? extends T> cfThis, Function<? super T,? extends U1> fn1, Function<? super T,? extends U2> fn2, Function<? super T,? extends U3> fn3)
    Returns a new CompletableFuture that, when the given stage completes normally, is executed using the CompletableFuture's default asynchronous execution facility, with the values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the same order of the given Functions arguments.
    static <T, U1, U2, U3, U4>
    CompletableFuture<Tuple4<U1,U2,U3,U4>>
    thenTupleMApplyAsync(CompletableFuture<? extends T> cfThis, Function<? super T,? extends U1> fn1, Function<? super T,? extends U2> fn2, Function<? super T,? extends U3> fn3, Function<? super T,? extends U4> fn4)
    Returns a new CompletableFuture that, when the given stage completes normally, is executed using the CompletableFuture's default asynchronous execution facility, with the values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the same order of the given Functions arguments.
    static <T, U1, U2, U3, U4, U5>
    CompletableFuture<Tuple5<U1,U2,U3,U4,U5>>
    thenTupleMApplyAsync(CompletableFuture<? extends T> cfThis, Function<? super T,? extends U1> fn1, Function<? super T,? extends U2> fn2, Function<? super T,? extends U3> fn3, Function<? super T,? extends U4> fn4, Function<? super T,? extends U5> fn5)
    Returns a new CompletableFuture that, when the given stage completes normally, is executed using the CompletableFuture's default asynchronous execution facility, with the values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the same order of the given Functions arguments.
    static <T, U1, U2>
    CompletableFuture<Tuple2<U1,U2>>
    thenTupleMApplyFastFailAsync(CompletableFuture<? extends T> cfThis, Executor executor, Function<? super T,? extends U1> fn1, Function<? super T,? extends U2> fn2)
    Returns a new CompletableFuture that, when the given stage completes normally, is executed using the given Executor, with the values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the same order of the given Functions arguments.
    static <T, U1, U2, U3>
    CompletableFuture<Tuple3<U1,U2,U3>>
    thenTupleMApplyFastFailAsync(CompletableFuture<? extends T> cfThis, Executor executor, Function<? super T,? extends U1> fn1, Function<? super T,? extends U2> fn2, Function<? super T,? extends U3> fn3)
    Returns a new CompletableFuture that, when the given stage completes normally, is executed using the given Executor, with the values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the same order of the given Functions arguments.
    static <T, U1, U2, U3, U4>
    CompletableFuture<Tuple4<U1,U2,U3,U4>>
    thenTupleMApplyFastFailAsync(CompletableFuture<? extends T> cfThis, Executor executor, Function<? super T,? extends U1> fn1, Function<? super T,? extends U2> fn2, Function<? super T,? extends U3> fn3, Function<? super T,? extends U4> fn4)
    Returns a new CompletableFuture that, when the given stage completes normally, is executed using the given Executor, with the values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the same order of the given Functions arguments.
    static <T, U1, U2, U3, U4, U5>
    CompletableFuture<Tuple5<U1,U2,U3,U4,U5>>
    thenTupleMApplyFastFailAsync(CompletableFuture<? extends T> cfThis, Executor executor, Function<? super T,? extends U1> fn1, Function<? super T,? extends U2> fn2, Function<? super T,? extends U3> fn3, Function<? super T,? extends U4> fn4, Function<? super T,? extends U5> fn5)
    Returns a new CompletableFuture that, when the given stage completes normally, is executed using the given Executor, with the values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the same order of the given Functions arguments.
    static <T, U1, U2>
    CompletableFuture<Tuple2<U1,U2>>
    thenTupleMApplyFastFailAsync(CompletableFuture<? extends T> cfThis, Function<? super T,? extends U1> fn1, Function<? super T,? extends U2> fn2)
    Returns a new CompletableFuture that, when the given stage completes normally, is executed using the CompletableFuture's default asynchronous execution facility, with the values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the same order of the given Functions arguments.
    static <T, U1, U2, U3>
    CompletableFuture<Tuple3<U1,U2,U3>>
    thenTupleMApplyFastFailAsync(CompletableFuture<? extends T> cfThis, Function<? super T,? extends U1> fn1, Function<? super T,? extends U2> fn2, Function<? super T,? extends U3> fn3)
    Returns a new CompletableFuture that, when the given stage completes normally, is executed using the CompletableFuture's default asynchronous execution facility, with the values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the same order of the given Functions arguments.
    static <T, U1, U2, U3, U4>
    CompletableFuture<Tuple4<U1,U2,U3,U4>>
    thenTupleMApplyFastFailAsync(CompletableFuture<? extends T> cfThis, Function<? super T,? extends U1> fn1, Function<? super T,? extends U2> fn2, Function<? super T,? extends U3> fn3, Function<? super T,? extends U4> fn4)
    Returns a new CompletableFuture that, when the given stage completes normally, is executed using the CompletableFuture's default asynchronous execution facility, with the values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the same order of the given Functions arguments.
    static <T, U1, U2, U3, U4, U5>
    CompletableFuture<Tuple5<U1,U2,U3,U4,U5>>
    thenTupleMApplyFastFailAsync(CompletableFuture<? extends T> cfThis, Function<? super T,? extends U1> fn1, Function<? super T,? extends U2> fn2, Function<? super T,? extends U3> fn3, Function<? super T,? extends U4> fn4, Function<? super T,? extends U5> fn5)
    Returns a new CompletableFuture that, when the given stage completes normally, is executed using the CompletableFuture's default asynchronous execution facility, with the values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the same order of the given Functions arguments.
    static <T, U1, U2>
    CompletableFuture<Tuple2<U1,U2>>
    thenTupleMApplyMostSuccessAsync(CompletableFuture<? extends T> cfThis, long timeout, TimeUnit unit, Function<? super T,? extends U1> fn1, Function<? super T,? extends U2> fn2)
    Returns a new CompletableFuture that, when the given stage completes normally, is executed using the CompletableFuture's default asynchronous execution facility, with the most values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the given time(timeout, aka as many results as possible in the given time) in the same order of the given Functions arguments.
    static <T, U1, U2, U3>
    CompletableFuture<Tuple3<U1,U2,U3>>
    thenTupleMApplyMostSuccessAsync(CompletableFuture<? extends T> cfThis, long timeout, TimeUnit unit, Function<? super T,? extends U1> fn1, Function<? super T,? extends U2> fn2, Function<? super T,? extends U3> fn3)
    Returns a new CompletableFuture that, when the given stage completes normally, is executed using the CompletableFuture's default asynchronous execution facility, with the most values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the given time(timeout, aka as many results as possible in the given time) in the same order of the given Functions arguments.
    static <T, U1, U2, U3, U4>
    CompletableFuture<Tuple4<U1,U2,U3,U4>>
    thenTupleMApplyMostSuccessAsync(CompletableFuture<? extends T> cfThis, long timeout, TimeUnit unit, Function<? super T,? extends U1> fn1, Function<? super T,? extends U2> fn2, Function<? super T,? extends U3> fn3, Function<? super T,? extends U4> fn4)
    Returns a new CompletableFuture that, when the given stage completes normally, is executed using the CompletableFuture's default asynchronous execution facility, with the most values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the given time(timeout, aka as many results as possible in the given time) in the same order of the given Functions arguments.
    static <T, U1, U2, U3, U4, U5>
    CompletableFuture<Tuple5<U1,U2,U3,U4,U5>>
    thenTupleMApplyMostSuccessAsync(CompletableFuture<? extends T> cfThis, long timeout, TimeUnit unit, Function<? super T,? extends U1> fn1, Function<? super T,? extends U2> fn2, Function<? super T,? extends U3> fn3, Function<? super T,? extends U4> fn4, Function<? super T,? extends U5> fn5)
    Returns a new CompletableFuture that, when the given stage completes normally, is executed using the CompletableFuture's default asynchronous execution facility, with the most values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the given time(timeout, aka as many results as possible in the given time) in the same order of the given Functions arguments.
    static <T, U1, U2>
    CompletableFuture<Tuple2<U1,U2>>
    thenTupleMApplyMostSuccessAsync(CompletableFuture<? extends T> cfThis, Executor executor, long timeout, TimeUnit unit, Function<? super T,? extends U1> fn1, Function<? super T,? extends U2> fn2)
    Returns a new CompletableFuture that, when the given stage completes normally, is executed using the given Executor, with the most values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the given time(timeout, aka as many results as possible in the given time) in the same order of the given Functions arguments.
    static <T, U1, U2, U3>
    CompletableFuture<Tuple3<U1,U2,U3>>
    thenTupleMApplyMostSuccessAsync(CompletableFuture<? extends T> cfThis, Executor executor, long timeout, TimeUnit unit, Function<? super T,? extends U1> fn1, Function<? super T,? extends U2> fn2, Function<? super T,? extends U3> fn3)
    Returns a new CompletableFuture that, when the given stage completes normally, is executed using the given Executor, with the most values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the given time(timeout, aka as many results as possible in the given time) in the same order of the given Functions arguments.
    static <T, U1, U2, U3, U4>
    CompletableFuture<Tuple4<U1,U2,U3,U4>>
    thenTupleMApplyMostSuccessAsync(CompletableFuture<? extends T> cfThis, Executor executor, long timeout, TimeUnit unit, Function<? super T,? extends U1> fn1, Function<? super T,? extends U2> fn2, Function<? super T,? extends U3> fn3, Function<? super T,? extends U4> fn4)
    Returns a new CompletableFuture that, when the given stage completes normally, is executed using the given Executor, with the most values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the given time(timeout, aka as many results as possible in the given time) in the same order of the given Functions arguments.
    static <T, U1, U2, U3, U4, U5>
    CompletableFuture<Tuple5<U1,U2,U3,U4,U5>>
    thenTupleMApplyMostSuccessAsync(CompletableFuture<? extends T> cfThis, Executor executor, long timeout, TimeUnit unit, Function<? super T,? extends U1> fn1, Function<? super T,? extends U2> fn2, Function<? super T,? extends U3> fn3, Function<? super T,? extends U4> fn4, Function<? super T,? extends U5> fn5)
    Returns a new CompletableFuture that, when the given stage completes normally, is executed using the given Executor, with the most values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the given time(timeout, aka as many results as possible in the given time) in the same order of the given Functions arguments.
    static <T> CompletableFuture<T>[]
    A convenient util method for converting input CompletionStage (including Cffu/CompletableFuture) array element by CompletionStage.toCompletableFuture().
    static <T1, T2> CompletableFuture<Tuple2<T1,T2>>
    tupleMSupplyAllSuccessAsync(Executor executor, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2)
    Returns a new CompletableFuture that is asynchronously completed by tasks running in the given executor with the successfully values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
    static <T1, T2, T3>
    CompletableFuture<Tuple3<T1,T2,T3>>
    tupleMSupplyAllSuccessAsync(Executor executor, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3)
    Returns a new CompletableFuture that is asynchronously completed by tasks running in the given executor with the successfully values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
    static <T1, T2, T3, T4>
    CompletableFuture<Tuple4<T1,T2,T3,T4>>
    tupleMSupplyAllSuccessAsync(Executor executor, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4)
    Returns a new CompletableFuture that is asynchronously completed by tasks running in the given executor with the successfully values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
    static <T1, T2, T3, T4, T5>
    CompletableFuture<Tuple5<T1,T2,T3,T4,T5>>
    tupleMSupplyAllSuccessAsync(Executor executor, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4, Supplier<? extends T5> supplier5)
    Returns a new CompletableFuture that is asynchronously completed by tasks running in the given executor with the successfully values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
    static <T1, T2> CompletableFuture<Tuple2<T1,T2>>
    tupleMSupplyAllSuccessAsync(Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2)
    Returns a new CompletableFuture that is asynchronously completed by tasks running in the CompletableFuture's default asynchronous execution facility with the successful values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
    static <T1, T2, T3>
    CompletableFuture<Tuple3<T1,T2,T3>>
    tupleMSupplyAllSuccessAsync(Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3)
    Returns a new CompletableFuture that is asynchronously completed by tasks running in the CompletableFuture's default asynchronous execution facility with the successful values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
    static <T1, T2, T3, T4>
    CompletableFuture<Tuple4<T1,T2,T3,T4>>
    tupleMSupplyAllSuccessAsync(Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4)
    Returns a new CompletableFuture that is asynchronously completed by tasks running in the CompletableFuture's default asynchronous execution facility with the successful values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
    static <T1, T2, T3, T4, T5>
    CompletableFuture<Tuple5<T1,T2,T3,T4,T5>>
    tupleMSupplyAllSuccessAsync(Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4, Supplier<? extends T5> supplier5)
    Returns a new CompletableFuture that is asynchronously completed by tasks running in the CompletableFuture's default asynchronous execution facility with the successful values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
    static <T1, T2> CompletableFuture<Tuple2<T1,T2>>
    tupleMSupplyAsync(Executor executor, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2)
    Returns a new CompletableFuture that is asynchronously completed by tasks running in the given Executor with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
    static <T1, T2, T3>
    CompletableFuture<Tuple3<T1,T2,T3>>
    tupleMSupplyAsync(Executor executor, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3)
    Returns a new CompletableFuture that is asynchronously completed by tasks running in the given Executor with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
    static <T1, T2, T3, T4>
    CompletableFuture<Tuple4<T1,T2,T3,T4>>
    tupleMSupplyAsync(Executor executor, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4)
    Returns a new CompletableFuture that is asynchronously completed by tasks running in the given Executor with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
    static <T1, T2, T3, T4, T5>
    CompletableFuture<Tuple5<T1,T2,T3,T4,T5>>
    tupleMSupplyAsync(Executor executor, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4, Supplier<? extends T5> supplier5)
    Returns a new CompletableFuture that is asynchronously completed by tasks running in the given Executor with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
    static <T1, T2> CompletableFuture<Tuple2<T1,T2>>
    tupleMSupplyAsync(Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2)
    Returns a new CompletableFuture that is asynchronously completed by tasks running in the CompletableFuture's default asynchronous execution facility with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
    static <T1, T2, T3>
    CompletableFuture<Tuple3<T1,T2,T3>>
    tupleMSupplyAsync(Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3)
    Returns a new CompletableFuture that is asynchronously completed by tasks running in the CompletableFuture's default asynchronous execution facility with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
    static <T1, T2, T3, T4>
    CompletableFuture<Tuple4<T1,T2,T3,T4>>
    tupleMSupplyAsync(Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4)
    Returns a new CompletableFuture that is asynchronously completed by tasks running in the CompletableFuture's default asynchronous execution facility with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
    static <T1, T2, T3, T4, T5>
    CompletableFuture<Tuple5<T1,T2,T3,T4,T5>>
    tupleMSupplyAsync(Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4, Supplier<? extends T5> supplier5)
    Returns a new CompletableFuture that is asynchronously completed by tasks running in the CompletableFuture's default asynchronous execution facility with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
    static <T1, T2> CompletableFuture<Tuple2<T1,T2>>
    tupleMSupplyFastFailAsync(Executor executor, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2)
    Returns a new CompletableFuture that is asynchronously completed by tasks running in the given Executor with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
    static <T1, T2, T3>
    CompletableFuture<Tuple3<T1,T2,T3>>
    tupleMSupplyFastFailAsync(Executor executor, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3)
    Returns a new CompletableFuture that is asynchronously completed by tasks running in the given Executor with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
    static <T1, T2, T3, T4>
    CompletableFuture<Tuple4<T1,T2,T3,T4>>
    tupleMSupplyFastFailAsync(Executor executor, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4)
    Returns a new CompletableFuture that is asynchronously completed by tasks running in the given Executor with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
    static <T1, T2, T3, T4, T5>
    CompletableFuture<Tuple5<T1,T2,T3,T4,T5>>
    tupleMSupplyFastFailAsync(Executor executor, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4, Supplier<? extends T5> supplier5)
    Returns a new CompletableFuture that is asynchronously completed by tasks running in the given Executor with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
    static <T1, T2> CompletableFuture<Tuple2<T1,T2>>
    tupleMSupplyFastFailAsync(Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2)
    Returns a new CompletableFuture that is asynchronously completed by tasks running in the CompletableFuture's default asynchronous execution facility with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
    static <T1, T2, T3>
    CompletableFuture<Tuple3<T1,T2,T3>>
    tupleMSupplyFastFailAsync(Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3)
    Returns a new CompletableFuture that is asynchronously completed by tasks running in the CompletableFuture's default asynchronous execution facility with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
    static <T1, T2, T3, T4>
    CompletableFuture<Tuple4<T1,T2,T3,T4>>
    tupleMSupplyFastFailAsync(Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4)
    Returns a new CompletableFuture that is asynchronously completed by tasks running in the CompletableFuture's default asynchronous execution facility with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
    static <T1, T2, T3, T4, T5>
    CompletableFuture<Tuple5<T1,T2,T3,T4,T5>>
    tupleMSupplyFastFailAsync(Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4, Supplier<? extends T5> supplier5)
    Returns a new CompletableFuture that is asynchronously completed by tasks running in the CompletableFuture's default asynchronous execution facility with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
    static <T1, T2> CompletableFuture<Tuple2<T1,T2>>
    tupleMSupplyMostSuccessAsync(long timeout, TimeUnit unit, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2)
    Returns a new CompletableFuture that is asynchronously completed by tasks running in the CompletableFuture's default asynchronous execution facility with the most values obtained by calling the given Suppliers in the given time(timeout, aka as many results as possible in the given time) in the same order of the given Suppliers arguments.
    static <T1, T2, T3>
    CompletableFuture<Tuple3<T1,T2,T3>>
    tupleMSupplyMostSuccessAsync(long timeout, TimeUnit unit, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3)
    Returns a new CompletableFuture that is asynchronously completed by tasks running in the CompletableFuture's default asynchronous execution facility with the most values obtained by calling the given Suppliers in the given time(timeout, aka as many results as possible in the given time) in the same order of the given Suppliers arguments.
    static <T1, T2, T3, T4>
    CompletableFuture<Tuple4<T1,T2,T3,T4>>
    tupleMSupplyMostSuccessAsync(long timeout, TimeUnit unit, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4)
    Returns a new CompletableFuture that is asynchronously completed by tasks running in the CompletableFuture's default asynchronous execution facility with the most values obtained by calling the given Suppliers in the given time(timeout, aka as many results as possible in the given time) in the same order of the given Suppliers arguments.
    static <T1, T2, T3, T4, T5>
    CompletableFuture<Tuple5<T1,T2,T3,T4,T5>>
    tupleMSupplyMostSuccessAsync(long timeout, TimeUnit unit, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4, Supplier<? extends T5> supplier5)
    Returns a new CompletableFuture that is asynchronously completed by tasks running in the CompletableFuture's default asynchronous execution facility with the most values obtained by calling the given Suppliers in the given time(timeout, aka as many results as possible in the given time) in the same order of the given Suppliers arguments.
    static <T1, T2> CompletableFuture<Tuple2<T1,T2>>
    tupleMSupplyMostSuccessAsync(Executor executor, long timeout, TimeUnit unit, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2)
    Returns a new CompletableFuture that is asynchronously completed by tasks running in the given Executor with the most values obtained by calling the given Suppliers in the given time(timeout, aka as many results as possible in the given time) in the same order of the given Suppliers arguments.
    static <T1, T2, T3>
    CompletableFuture<Tuple3<T1,T2,T3>>
    tupleMSupplyMostSuccessAsync(Executor executor, long timeout, TimeUnit unit, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3)
    Returns a new CompletableFuture that is asynchronously completed by tasks running in the given Executor with the most values obtained by calling the given Suppliers in the given time(timeout, aka as many results as possible in the given time) in the same order of the given Suppliers arguments.
    static <T1, T2, T3, T4>
    CompletableFuture<Tuple4<T1,T2,T3,T4>>
    tupleMSupplyMostSuccessAsync(Executor executor, long timeout, TimeUnit unit, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4)
    Returns a new CompletableFuture that is asynchronously completed by tasks running in the given Executor with the most values obtained by calling the given Suppliers in the given time(timeout, aka as many results as possible in the given time) in the same order of the given Suppliers arguments.
    static <T1, T2, T3, T4, T5>
    CompletableFuture<Tuple5<T1,T2,T3,T4,T5>>
    tupleMSupplyMostSuccessAsync(Executor executor, long timeout, TimeUnit unit, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4, Supplier<? extends T5> supplier5)
    Returns a new CompletableFuture that is asynchronously completed by tasks running in the given Executor with the most values obtained by calling the given Suppliers in the given time(timeout, aka as many results as possible in the given time) in the same order of the given Suppliers arguments.
    static Throwable
    A convenient util method for unwrapping CF exception (CompletionException/ExecutionException) to the biz exception.

    Methods inherited from class java.lang.Object

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

    • mSupplyFastFailAsync

      @SafeVarargs public static <T> CompletableFuture<List<T>> mSupplyFastFailAsync(Supplier<? extends T>... suppliers)
      Returns a new CompletableFuture that is asynchronously completed by tasks running in the CompletableFuture's default asynchronous execution facility with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
      Type Parameters:
      T - the suppliers' return type
      Parameters:
      suppliers - the suppliers returning the value to be used to complete the returned CompletableFuture
      Returns:
      the new CompletableFuture
      See Also:
    • mSupplyFastFailAsync

      @SafeVarargs public static <T> CompletableFuture<List<T>> mSupplyFastFailAsync(Executor executor, Supplier<? extends T>... suppliers)
      Returns a new CompletableFuture that is asynchronously completed by tasks running in the given Executor with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
      Type Parameters:
      T - the suppliers' return type
      Parameters:
      executor - the executor to use for asynchronous execution
      suppliers - the suppliers returning the value to be used to complete the returned CompletableFuture
      Returns:
      the new CompletableFuture
      See Also:
    • mSupplyAllSuccessAsync

      @SafeVarargs public static <T> CompletableFuture<List<T>> mSupplyAllSuccessAsync(@Nullable T valueIfFailed, Supplier<? extends T>... suppliers)
      Returns a new CompletableFuture that is asynchronously completed by tasks running in the CompletableFuture's default asynchronous execution facility with the successful values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.

      If the given supplier failed, use the given valueIfFailed.

      Type Parameters:
      T - the suppliers' return type
      Parameters:
      valueIfFailed - the value to return if not failed
      suppliers - the suppliers returning the value to be used to complete the returned CompletableFuture
      Returns:
      the new CompletableFuture
      See Also:
    • mSupplyAllSuccessAsync

      @SafeVarargs public static <T> CompletableFuture<List<T>> mSupplyAllSuccessAsync(@Nullable T valueIfFailed, Executor executor, Supplier<? extends T>... suppliers)
      Returns a new CompletableFuture that is asynchronously completed by tasks running in the given Executor with the successfully values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.

      If the given supplier failed, use the given valueIfFailed.

      Type Parameters:
      T - the suppliers' return type
      Parameters:
      valueIfFailed - the value to return if not failed
      executor - the executor to use for asynchronous execution
      suppliers - the suppliers returning the value to be used to complete the returned CompletableFuture
      Returns:
      the new CompletableFuture
      See Also:
    • mSupplyMostSuccessAsync

      @SafeVarargs public static <T> CompletableFuture<List<T>> mSupplyMostSuccessAsync(@Nullable T valueIfNotSuccess, long timeout, TimeUnit unit, Supplier<? extends T>... suppliers)
      Returns a new CompletableFuture that is asynchronously completed by tasks running in the CompletableFuture's default asynchronous execution facility with the most values obtained by calling the given Suppliers in the given time(timeout, aka as many results as possible in the given time) in the same order of the given Suppliers arguments.

      If the given supplier is successful in the given time, the return result is the completed value; Otherwise the given valueIfNotSuccess.

      Type Parameters:
      T - the suppliers' return type
      Parameters:
      valueIfNotSuccess - the value to return if not completed successfully
      timeout - how long to wait in units of unit
      unit - a TimeUnit determining how to interpret the timeout parameter
      suppliers - the suppliers returning the value to be used to complete the returned CompletableFuture
      Returns:
      the new CompletableFuture
      See Also:
    • mSupplyMostSuccessAsync

      @SafeVarargs public static <T> CompletableFuture<List<T>> mSupplyMostSuccessAsync(@Nullable T valueIfNotSuccess, Executor executor, long timeout, TimeUnit unit, Supplier<? extends T>... suppliers)
      Returns a new CompletableFuture that is asynchronously completed by tasks running in the given Executor with the most values obtained by calling the given Suppliers in the given time(timeout, aka as many results as possible in the given time) in the same order of the given Suppliers arguments.

      If the given supplier is successful in the given time, the return result is the completed value; Otherwise the given valueIfNotSuccess.

      Type Parameters:
      T - the suppliers' return type
      Parameters:
      valueIfNotSuccess - the value to return if not completed successfully
      executor - the executor to use for asynchronous execution
      timeout - how long to wait in units of unit
      unit - a TimeUnit determining how to interpret the timeout parameter
      suppliers - the suppliers returning the value to be used to complete the returned CompletableFuture
      Returns:
      the new CompletableFuture
      See Also:
    • mSupplyAsync

      @SafeVarargs public static <T> CompletableFuture<List<T>> mSupplyAsync(Supplier<? extends T>... suppliers)
      Returns a new CompletableFuture that is asynchronously completed by tasks running in the CompletableFuture's default asynchronous execution facility with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
      Type Parameters:
      T - the suppliers' return type
      Parameters:
      suppliers - the suppliers returning the value to be used to complete the returned CompletableFuture
      Returns:
      the new CompletableFuture
      See Also:
    • mSupplyAsync

      @SafeVarargs public static <T> CompletableFuture<List<T>> mSupplyAsync(Executor executor, Supplier<? extends T>... suppliers)
      Returns a new CompletableFuture that is asynchronously completed by tasks running in the given Executor with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
      Type Parameters:
      T - the suppliers' return type
      Parameters:
      executor - the executor to use for asynchronous execution
      suppliers - the suppliers returning the value to be used to complete the returned CompletableFuture
      Returns:
      the new CompletableFuture
      See Also:
    • mSupplyAnySuccessAsync

      @SafeVarargs public static <T> CompletableFuture<T> mSupplyAnySuccessAsync(Supplier<? extends T>... suppliers)
      Returns a new CompletableFuture that is asynchronously successful when any of tasks running in the CompletableFuture's default asynchronous execution facility by calling the given Suppliers success, with the same result. Otherwise, all the given tasks complete exceptionally, the returned CompletableFuture also does so, with a CompletionException holding an exception from any of the given stages as its cause. If no suppliers are provided, returns a new CompletableFuture that is already completed exceptionally with a CompletionException holding a NoCfsProvidedException as its cause.
      Type Parameters:
      T - the suppliers' return type
      Parameters:
      suppliers - the suppliers returning the value to be used to complete the returned CompletableFuture
      Returns:
      the new CompletableFuture
      See Also:
    • mSupplyAnySuccessAsync

      @SafeVarargs public static <T> CompletableFuture<T> mSupplyAnySuccessAsync(Executor executor, Supplier<? extends T>... suppliers)
      Returns a new CompletableFuture that is asynchronously successful when any of tasks running in the given executor by calling the given Suppliers success, with the same result. Otherwise, all the given tasks complete exceptionally, the returned CompletableFuture also does so, with a CompletionException holding an exception from any of the given stages as its cause. If no suppliers are provided, returns a new CompletableFuture that is already completed exceptionally with a CompletionException holding a NoCfsProvidedException as its cause.
      Type Parameters:
      T - the suppliers' return type
      Parameters:
      executor - the executor to use for asynchronous execution
      suppliers - the suppliers returning the value to be used to complete the returned CompletableFuture
      Returns:
      the new CompletableFuture
      See Also:
    • mSupplyAnyAsync

      @SafeVarargs public static <T> CompletableFuture<T> mSupplyAnyAsync(Supplier<? extends T>... suppliers)
      Returns a new CompletableFuture that is completed when any of tasks running in the CompletableFuture's default asynchronous execution facility by calling the given Suppliers complete, with the same result. Otherwise, if it completed exceptionally, the returned CompletableFuture also does so, with a CompletionException holding this exception as its cause. If no suppliers are provided, returns an incomplete CompletableFuture.
      Type Parameters:
      T - the suppliers' return type
      Parameters:
      suppliers - the suppliers returning the value to be used to complete the returned CompletableFuture
      Returns:
      the new CompletableFuture
      See Also:
    • mSupplyAnyAsync

      @SafeVarargs public static <T> CompletableFuture<T> mSupplyAnyAsync(Executor executor, Supplier<? extends T>... suppliers)
      Returns a new CompletableFuture that is completed when any of tasks running in the given Executor by calling the given Suppliers complete, with the same result. Otherwise, if it completed exceptionally, the returned CompletableFuture also does so, with a CompletionException holding this exception as its cause. If no suppliers are provided, returns an incomplete CompletableFuture.
      Type Parameters:
      T - the suppliers' return type
      Parameters:
      executor - the executor to use for asynchronous execution
      suppliers - the suppliers returning the value to be used to complete the returned CompletableFuture
      Returns:
      the new CompletableFuture
      See Also:
    • mRunFastFailAsync

      public static CompletableFuture<Void> mRunFastFailAsync(Runnable... actions)
      Returns a new CompletableFuture that is asynchronously completed by tasks running in the CompletableFuture's default asynchronous execution facility after runs the given actions.
      Parameters:
      actions - the actions to run before completing the returned CompletableFuture
      Returns:
      the new CompletableFuture
      See Also:
    • mRunFastFailAsync

      public static CompletableFuture<Void> mRunFastFailAsync(Executor executor, Runnable... actions)
      Returns a new CompletableFuture that is asynchronously completed by tasks running in the given Executor after runs the given actions.
      Parameters:
      executor - the executor to use for asynchronous execution
      actions - the actions to run before completing the returned CompletableFuture
      Returns:
      the new CompletableFuture
      See Also:
    • mRunAsync

      public static CompletableFuture<Void> mRunAsync(Runnable... actions)
      Returns a new CompletableFuture that is asynchronously completed by tasks running in the CompletableFuture's default asynchronous execution facility after runs the given actions.
      Parameters:
      actions - the actions to run before completing the returned CompletableFuture
      Returns:
      the new CompletableFuture
      See Also:
    • mRunAsync

      public static CompletableFuture<Void> mRunAsync(Executor executor, Runnable... actions)
      Returns a new CompletableFuture that is asynchronously completed by tasks running in the given Executor after runs the given actions.
      Parameters:
      executor - the executor to use for asynchronous execution
      actions - the actions to run before completing the returned CompletableFuture
      Returns:
      the new CompletableFuture
      See Also:
    • mRunAnySuccessAsync

      public static CompletableFuture<Void> mRunAnySuccessAsync(Runnable... actions)
      Returns a new CompletableFuture that is asynchronously successful when any tasks running in the CompletableFuture's default asynchronous execution facility success.
      Parameters:
      actions - the actions to run to complete the returned CompletableFuture
      Returns:
      the new CompletableFuture
      See Also:
    • mRunAnySuccessAsync

      public static CompletableFuture<Void> mRunAnySuccessAsync(Executor executor, Runnable... actions)
      Returns a new CompletableFuture that is asynchronously successful when any tasks running in the given executor success.
      Parameters:
      executor - the executor to use for asynchronous execution
      actions - the actions to run to complete the returned CompletableFuture
      Returns:
      the new CompletableFuture
      See Also:
    • mRunAnyAsync

      public static CompletableFuture<Void> mRunAnyAsync(Runnable... actions)
      Returns a new CompletableFuture that is asynchronously completed when any tasks running in the CompletableFuture's default asynchronous execution facility.
      Parameters:
      actions - the actions to run to complete the returned CompletableFuture
      Returns:
      the new CompletableFuture
      See Also:
    • mRunAnyAsync

      public static CompletableFuture<Void> mRunAnyAsync(Executor executor, Runnable... actions)
      Returns a new CompletableFuture that is asynchronously completed when any tasks running in the given executor complete.
      Parameters:
      executor - the executor to use for asynchronous execution
      actions - the actions to run to complete the returned CompletableFuture
      Returns:
      the new CompletableFuture
      See Also:
    • tupleMSupplyFastFailAsync

      public static <T1, T2> CompletableFuture<Tuple2<T1,T2>> tupleMSupplyFastFailAsync(Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2)
      Returns a new CompletableFuture that is asynchronously completed by tasks running in the CompletableFuture's default asynchronous execution facility with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
      Returns:
      the new CompletableFuture
      See Also:
    • tupleMSupplyFastFailAsync

      public static <T1, T2> CompletableFuture<Tuple2<T1,T2>> tupleMSupplyFastFailAsync(Executor executor, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2)
      Returns a new CompletableFuture that is asynchronously completed by tasks running in the given Executor with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
      Parameters:
      executor - the executor to use for asynchronous execution
      Returns:
      the new CompletableFuture
      See Also:
    • tupleMSupplyFastFailAsync

      public static <T1, T2, T3> CompletableFuture<Tuple3<T1,T2,T3>> tupleMSupplyFastFailAsync(Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3)
      Returns a new CompletableFuture that is asynchronously completed by tasks running in the CompletableFuture's default asynchronous execution facility with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
      Returns:
      the new CompletableFuture
      See Also:
    • tupleMSupplyFastFailAsync

      public static <T1, T2, T3> CompletableFuture<Tuple3<T1,T2,T3>> tupleMSupplyFastFailAsync(Executor executor, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3)
      Returns a new CompletableFuture that is asynchronously completed by tasks running in the given Executor with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
      Parameters:
      executor - the executor to use for asynchronous execution
      Returns:
      the new CompletableFuture
      See Also:
    • tupleMSupplyFastFailAsync

      public static <T1, T2, T3, T4> CompletableFuture<Tuple4<T1,T2,T3,T4>> tupleMSupplyFastFailAsync(Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4)
      Returns a new CompletableFuture that is asynchronously completed by tasks running in the CompletableFuture's default asynchronous execution facility with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
      Returns:
      the new CompletableFuture
      See Also:
    • tupleMSupplyFastFailAsync

      public static <T1, T2, T3, T4> CompletableFuture<Tuple4<T1,T2,T3,T4>> tupleMSupplyFastFailAsync(Executor executor, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4)
      Returns a new CompletableFuture that is asynchronously completed by tasks running in the given Executor with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
      Parameters:
      executor - the executor to use for asynchronous execution
      Returns:
      the new CompletableFuture
      See Also:
    • tupleMSupplyFastFailAsync

      public static <T1, T2, T3, T4, T5> CompletableFuture<Tuple5<T1,T2,T3,T4,T5>> tupleMSupplyFastFailAsync(Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4, Supplier<? extends T5> supplier5)
      Returns a new CompletableFuture that is asynchronously completed by tasks running in the CompletableFuture's default asynchronous execution facility with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
      Returns:
      the new CompletableFuture
      See Also:
    • tupleMSupplyFastFailAsync

      public static <T1, T2, T3, T4, T5> CompletableFuture<Tuple5<T1,T2,T3,T4,T5>> tupleMSupplyFastFailAsync(Executor executor, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4, Supplier<? extends T5> supplier5)
      Returns a new CompletableFuture that is asynchronously completed by tasks running in the given Executor with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
      Parameters:
      executor - the executor to use for asynchronous execution
      Returns:
      the new CompletableFuture
      See Also:
    • tupleMSupplyAllSuccessAsync

      public static <T1, T2> CompletableFuture<Tuple2<T1,T2>> tupleMSupplyAllSuccessAsync(Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2)
      Returns a new CompletableFuture that is asynchronously completed by tasks running in the CompletableFuture's default asynchronous execution facility with the successful values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.

      If the given supplier failed, use null.

      Returns:
      the new CompletableFuture
      See Also:
    • tupleMSupplyAllSuccessAsync

      public static <T1, T2> CompletableFuture<Tuple2<T1,T2>> tupleMSupplyAllSuccessAsync(Executor executor, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2)
      Returns a new CompletableFuture that is asynchronously completed by tasks running in the given executor with the successfully values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.

      If the given supplier failed, use null.

      Parameters:
      executor - the executor to use for asynchronous execution
      Returns:
      the new CompletableFuture
      See Also:
    • tupleMSupplyAllSuccessAsync

      public static <T1, T2, T3> CompletableFuture<Tuple3<T1,T2,T3>> tupleMSupplyAllSuccessAsync(Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3)
      Returns a new CompletableFuture that is asynchronously completed by tasks running in the CompletableFuture's default asynchronous execution facility with the successful values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.

      If the given supplier failed, use null.

      Returns:
      the new CompletableFuture
      See Also:
    • tupleMSupplyAllSuccessAsync

      public static <T1, T2, T3> CompletableFuture<Tuple3<T1,T2,T3>> tupleMSupplyAllSuccessAsync(Executor executor, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3)
      Returns a new CompletableFuture that is asynchronously completed by tasks running in the given executor with the successfully values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.

      If the given supplier failed, use null.

      Parameters:
      executor - the executor to use for asynchronous execution
      Returns:
      the new CompletableFuture
      See Also:
    • tupleMSupplyAllSuccessAsync

      public static <T1, T2, T3, T4> CompletableFuture<Tuple4<T1,T2,T3,T4>> tupleMSupplyAllSuccessAsync(Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4)
      Returns a new CompletableFuture that is asynchronously completed by tasks running in the CompletableFuture's default asynchronous execution facility with the successful values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.

      If the given supplier failed, use null.

      Returns:
      the new CompletableFuture
      See Also:
    • tupleMSupplyAllSuccessAsync

      public static <T1, T2, T3, T4> CompletableFuture<Tuple4<T1,T2,T3,T4>> tupleMSupplyAllSuccessAsync(Executor executor, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4)
      Returns a new CompletableFuture that is asynchronously completed by tasks running in the given executor with the successfully values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.

      If the given supplier failed, use null.

      Parameters:
      executor - the executor to use for asynchronous execution
      Returns:
      the new CompletableFuture
      See Also:
    • tupleMSupplyAllSuccessAsync

      public static <T1, T2, T3, T4, T5> CompletableFuture<Tuple5<T1,T2,T3,T4,T5>> tupleMSupplyAllSuccessAsync(Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4, Supplier<? extends T5> supplier5)
      Returns a new CompletableFuture that is asynchronously completed by tasks running in the CompletableFuture's default asynchronous execution facility with the successful values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.

      If the given supplier failed, use null.

      Returns:
      the new CompletableFuture
      See Also:
    • tupleMSupplyAllSuccessAsync

      public static <T1, T2, T3, T4, T5> CompletableFuture<Tuple5<T1,T2,T3,T4,T5>> tupleMSupplyAllSuccessAsync(Executor executor, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4, Supplier<? extends T5> supplier5)
      Returns a new CompletableFuture that is asynchronously completed by tasks running in the given executor with the successfully values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.

      If the given supplier failed, use null.

      Parameters:
      executor - the executor to use for asynchronous execution
      Returns:
      the new CompletableFuture
      See Also:
    • tupleMSupplyMostSuccessAsync

      public static <T1, T2> CompletableFuture<Tuple2<T1,T2>> tupleMSupplyMostSuccessAsync(long timeout, TimeUnit unit, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2)
      Returns a new CompletableFuture that is asynchronously completed by tasks running in the CompletableFuture's default asynchronous execution facility with the most values obtained by calling the given Suppliers in the given time(timeout, aka as many results as possible in the given time) in the same order of the given Suppliers arguments.

      If the given supplier is successful in the given time, the return result is the completed value; Otherwise null.

      Parameters:
      timeout - how long to wait in units of unit
      unit - a TimeUnit determining how to interpret the timeout parameter
      Returns:
      the new CompletableFuture
      See Also:
    • tupleMSupplyMostSuccessAsync

      public static <T1, T2> CompletableFuture<Tuple2<T1,T2>> tupleMSupplyMostSuccessAsync(Executor executor, long timeout, TimeUnit unit, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2)
      Returns a new CompletableFuture that is asynchronously completed by tasks running in the given Executor with the most values obtained by calling the given Suppliers in the given time(timeout, aka as many results as possible in the given time) in the same order of the given Suppliers arguments.

      If the given supplier is successful in the given time, the return result is the completed value; Otherwise null.

      Parameters:
      executor - the executor to use for asynchronous execution
      timeout - how long to wait in units of unit
      unit - a TimeUnit determining how to interpret the timeout parameter
      Returns:
      the new CompletableFuture
      See Also:
    • tupleMSupplyMostSuccessAsync

      public static <T1, T2, T3> CompletableFuture<Tuple3<T1,T2,T3>> tupleMSupplyMostSuccessAsync(long timeout, TimeUnit unit, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3)
      Returns a new CompletableFuture that is asynchronously completed by tasks running in the CompletableFuture's default asynchronous execution facility with the most values obtained by calling the given Suppliers in the given time(timeout, aka as many results as possible in the given time) in the same order of the given Suppliers arguments.

      If the given supplier is successful in the given time, the return result is the completed value; Otherwise null.

      Parameters:
      timeout - how long to wait in units of unit
      unit - a TimeUnit determining how to interpret the timeout parameter
      Returns:
      the new CompletableFuture
      See Also:
    • tupleMSupplyMostSuccessAsync

      public static <T1, T2, T3> CompletableFuture<Tuple3<T1,T2,T3>> tupleMSupplyMostSuccessAsync(Executor executor, long timeout, TimeUnit unit, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3)
      Returns a new CompletableFuture that is asynchronously completed by tasks running in the given Executor with the most values obtained by calling the given Suppliers in the given time(timeout, aka as many results as possible in the given time) in the same order of the given Suppliers arguments.

      If the given supplier is successful in the given time, the return result is the completed value; Otherwise null.

      Parameters:
      executor - the executor to use for asynchronous execution
      timeout - how long to wait in units of unit
      unit - a TimeUnit determining how to interpret the timeout parameter
      Returns:
      the new CompletableFuture
      See Also:
    • tupleMSupplyMostSuccessAsync

      public static <T1, T2, T3, T4> CompletableFuture<Tuple4<T1,T2,T3,T4>> tupleMSupplyMostSuccessAsync(long timeout, TimeUnit unit, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4)
      Returns a new CompletableFuture that is asynchronously completed by tasks running in the CompletableFuture's default asynchronous execution facility with the most values obtained by calling the given Suppliers in the given time(timeout, aka as many results as possible in the given time) in the same order of the given Suppliers arguments.

      If the given supplier is successful in the given time, the return result is the completed value; Otherwise null.

      Parameters:
      timeout - how long to wait in units of unit
      unit - a TimeUnit determining how to interpret the timeout parameter
      Returns:
      the new CompletableFuture
      See Also:
    • tupleMSupplyMostSuccessAsync

      public static <T1, T2, T3, T4> CompletableFuture<Tuple4<T1,T2,T3,T4>> tupleMSupplyMostSuccessAsync(Executor executor, long timeout, TimeUnit unit, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4)
      Returns a new CompletableFuture that is asynchronously completed by tasks running in the given Executor with the most values obtained by calling the given Suppliers in the given time(timeout, aka as many results as possible in the given time) in the same order of the given Suppliers arguments.

      If the given supplier is successful in the given time, the return result is the completed value; Otherwise null.

      Parameters:
      executor - the executor to use for asynchronous execution
      timeout - how long to wait in units of unit
      unit - a TimeUnit determining how to interpret the timeout parameter
      Returns:
      the new CompletableFuture
      See Also:
    • tupleMSupplyMostSuccessAsync

      public static <T1, T2, T3, T4, T5> CompletableFuture<Tuple5<T1,T2,T3,T4,T5>> tupleMSupplyMostSuccessAsync(long timeout, TimeUnit unit, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4, Supplier<? extends T5> supplier5)
      Returns a new CompletableFuture that is asynchronously completed by tasks running in the CompletableFuture's default asynchronous execution facility with the most values obtained by calling the given Suppliers in the given time(timeout, aka as many results as possible in the given time) in the same order of the given Suppliers arguments.

      If the given supplier is successful in the given time, the return result is the completed value; Otherwise null.

      Parameters:
      timeout - how long to wait in units of unit
      unit - a TimeUnit determining how to interpret the timeout parameter
      Returns:
      the new CompletableFuture
      See Also:
    • tupleMSupplyMostSuccessAsync

      public static <T1, T2, T3, T4, T5> CompletableFuture<Tuple5<T1,T2,T3,T4,T5>> tupleMSupplyMostSuccessAsync(Executor executor, long timeout, TimeUnit unit, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4, Supplier<? extends T5> supplier5)
      Returns a new CompletableFuture that is asynchronously completed by tasks running in the given Executor with the most values obtained by calling the given Suppliers in the given time(timeout, aka as many results as possible in the given time) in the same order of the given Suppliers arguments.

      If the given supplier is successful in the given time, the return result is the completed value; Otherwise null.

      Parameters:
      executor - the executor to use for asynchronous execution
      timeout - how long to wait in units of unit
      unit - a TimeUnit determining how to interpret the timeout parameter
      Returns:
      the new CompletableFuture
      See Also:
    • tupleMSupplyAsync

      public static <T1, T2> CompletableFuture<Tuple2<T1,T2>> tupleMSupplyAsync(Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2)
      Returns a new CompletableFuture that is asynchronously completed by tasks running in the CompletableFuture's default asynchronous execution facility with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
      Returns:
      the new CompletableFuture
      See Also:
    • tupleMSupplyAsync

      public static <T1, T2> CompletableFuture<Tuple2<T1,T2>> tupleMSupplyAsync(Executor executor, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2)
      Returns a new CompletableFuture that is asynchronously completed by tasks running in the given Executor with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
      Parameters:
      executor - the executor to use for asynchronous execution
      Returns:
      the new CompletableFuture
      See Also:
    • tupleMSupplyAsync

      public static <T1, T2, T3> CompletableFuture<Tuple3<T1,T2,T3>> tupleMSupplyAsync(Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3)
      Returns a new CompletableFuture that is asynchronously completed by tasks running in the CompletableFuture's default asynchronous execution facility with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
      Returns:
      the new CompletableFuture
      See Also:
    • tupleMSupplyAsync

      public static <T1, T2, T3> CompletableFuture<Tuple3<T1,T2,T3>> tupleMSupplyAsync(Executor executor, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3)
      Returns a new CompletableFuture that is asynchronously completed by tasks running in the given Executor with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
      Parameters:
      executor - the executor to use for asynchronous execution
      Returns:
      the new CompletableFuture
      See Also:
    • tupleMSupplyAsync

      public static <T1, T2, T3, T4> CompletableFuture<Tuple4<T1,T2,T3,T4>> tupleMSupplyAsync(Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4)
      Returns a new CompletableFuture that is asynchronously completed by tasks running in the CompletableFuture's default asynchronous execution facility with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
      Returns:
      the new CompletableFuture
      See Also:
    • tupleMSupplyAsync

      public static <T1, T2, T3, T4> CompletableFuture<Tuple4<T1,T2,T3,T4>> tupleMSupplyAsync(Executor executor, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4)
      Returns a new CompletableFuture that is asynchronously completed by tasks running in the given Executor with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
      Parameters:
      executor - the executor to use for asynchronous execution
      Returns:
      the new CompletableFuture
      See Also:
    • tupleMSupplyAsync

      public static <T1, T2, T3, T4, T5> CompletableFuture<Tuple5<T1,T2,T3,T4,T5>> tupleMSupplyAsync(Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4, Supplier<? extends T5> supplier5)
      Returns a new CompletableFuture that is asynchronously completed by tasks running in the CompletableFuture's default asynchronous execution facility with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
      Returns:
      the new CompletableFuture
      See Also:
    • tupleMSupplyAsync

      public static <T1, T2, T3, T4, T5> CompletableFuture<Tuple5<T1,T2,T3,T4,T5>> tupleMSupplyAsync(Executor executor, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4, Supplier<? extends T5> supplier5)
      Returns a new CompletableFuture that is asynchronously completed by tasks running in the given Executor with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.
      Parameters:
      executor - the executor to use for asynchronous execution
      Returns:
      the new CompletableFuture
      See Also:
    • allResultsFastFailOf

      @Contract(pure=true) @SafeVarargs public static <T> CompletableFuture<List<T>> allResultsFastFailOf(CompletionStage<? extends T>... cfs)
      Returns a new CompletableFuture that is successful with the results in the same order of the given stages arguments when all the given stages success; If any of the given stages complete exceptionally, then the returned CompletableFuture also does so *without* waiting other incomplete given stages, with a CompletionException holding this exception as its cause. If no stages are provided, returns a CompletableFuture completed with the value empty list.

      This method is the same as allResultsOf(CompletionStage[]) except for the fast-fail behavior.

      Parameters:
      cfs - the stages
      Returns:
      a new CompletableFuture that is successful when all the given stages success
      Throws:
      NullPointerException - if the array or any of its elements are null
    • allSuccessResultsOf

      @Contract(pure=true) @SafeVarargs public static <T> CompletableFuture<List<T>> allSuccessResultsOf(@Nullable T valueIfFailed, CompletionStage<? extends T>... cfs)
      Returns a new CompletableFuture that is successful with the results in the same order of the given stages arguments when all the given stages completed; If the given stage complete exceptionally, treat it successful with value valueIfFailed. If no stages are provided, returns a CompletableFuture completed with the value empty list.
      Parameters:
      valueIfFailed - the value to return if not completed successfully
      cfs - the stages
      Throws:
      NullPointerException - if the array or any of its elements are null
      See Also:
    • mostSuccessResultsOf

      @Contract(pure=true) @SafeVarargs public static <T> CompletableFuture<List<T>> mostSuccessResultsOf(@Nullable T valueIfNotSuccess, long timeout, TimeUnit unit, CompletionStage<? extends T>... cfs)
      Returns a new CompletableFuture with the most results in the same order of the given stages arguments in the given time(timeout, aka as many results as possible in the given time).

      If the given stage is successful, its result is the completed value; Otherwise the given valueIfNotSuccess.

      Parameters:
      valueIfNotSuccess - the value to return if not completed successfully
      timeout - how long to wait in units of unit
      unit - a TimeUnit determining how to interpret the timeout parameter
      cfs - the stages
      See Also:
    • mostSuccessResultsOf

      @Contract(pure=true) @SafeVarargs public static <T> CompletableFuture<List<T>> mostSuccessResultsOf(@Nullable T valueIfNotSuccess, Executor executorWhenTimeout, long timeout, TimeUnit unit, CompletionStage<? extends T>... cfs)
      Returns a new CompletableFuture with the most results in the same order of the given stages arguments in the given time(timeout, aka as many results as possible in the given time).

      If the given stage is successful, its result is the completed value; Otherwise the given valueIfNotSuccess.

      Parameters:
      valueIfNotSuccess - the value to return if not completed successfully
      executorWhenTimeout - the async executor when triggered by timeout
      timeout - how long to wait in units of unit
      unit - a TimeUnit determining how to interpret the timeout parameter
      cfs - the stages
      See Also:
    • allResultsOf

      @Contract(pure=true) @SafeVarargs public static <T> CompletableFuture<List<T>> allResultsOf(CompletionStage<? extends T>... cfs)
      Returns a new CompletableFuture with the results in the same order of the given stages arguments, the new CompletableFuture is completed when all the given stages complete; If any of the given stages complete exceptionally, then the returned CompletableFuture also does so, with a CompletionException holding this exception as its cause. If no stages are provided, returns a CompletableFuture completed with the value empty list.

      This method is the same as allOf(CompletionStage[]), except that the returned CompletableFuture contains the results of the given stages.

      Parameters:
      cfs - the stages
      Returns:
      a new CompletableFuture that is completed when all the given stages complete
      Throws:
      NullPointerException - if the array or any of its elements are null
      See Also:
    • allFastFailOf

      @Contract(pure=true) public static CompletableFuture<Void> allFastFailOf(CompletionStage<?>... cfs)
      Returns a new CompletableFuture that is successful when all the given stages success; If any of the given stages complete exceptionally, then the returned CompletableFuture also does so *without* waiting other incomplete given stages, with a CompletionException holding this exception as its cause. Otherwise, the results, if any, of the given stages are not reflected in the returned CompletableFuture(CompletableFuture<Void>), but may be obtained by inspecting them individually. If no stages are provided, returns a CompletableFuture completed with the value null.

      This method is the same as allOf(CompletionStage[]) except for the fast-fail behavior.

      If you need the results of given stages, prefer below methods:

      If you need the successful results of given stages in the given time, prefer below methods:

      Parameters:
      cfs - the stages
      Returns:
      a new CompletableFuture that is successful when all the given stages success
      Throws:
      NullPointerException - if the array or any of its elements are null
    • allOf

      public static CompletableFuture<Void> allOf(CompletionStage<?>... cfs)
      Returns a new CompletableFuture that is completed when all the given stages complete; If any of the given stages complete exceptionally, then the returned CompletableFuture also does so, with a CompletionException holding this exception as its cause. Otherwise, the results, if any, of the given stages are not reflected in the returned CompletableFuture(CompletableFuture<Void>), but may be obtained by inspecting them individually. If no stages are provided, returns a CompletableFuture completed with the value null.

      This method is the same as CompletableFuture.allOf(CompletableFuture[]), except that the parameter type is more generic CompletionStage instead of CompletableFuture.

      If you need the results of given stages, prefer below methods:

      If you need the successful results of given stages in the given time, prefer below methods:

      Parameters:
      cfs - the stages
      Returns:
      a new CompletableFuture that is completed when all the given stages complete
      Throws:
      NullPointerException - if the array or any of its elements are null
    • anySuccessOf

      @Contract(pure=true) @SafeVarargs public static <T> CompletableFuture<T> anySuccessOf(CompletionStage<? extends T>... cfs)
      Returns a new CompletableFuture that is successful when any of the given stages success, with the same result. Otherwise, all the given stages complete exceptionally, the returned CompletableFuture also does so, with a CompletionException holding an exception from any of the given stages as its cause. If no stages are provided, returns a new CompletableFuture that is already completed exceptionally with a CompletionException holding a NoCfsProvidedException as its cause.

      This method is the same as anyOf(CompletionStage[]) except for the any-success behavior instead of any-complete.

      Parameters:
      cfs - the stages
      Returns:
      a new CompletableFuture that is successful when any of the given stages success, with the same result
      Throws:
      NullPointerException - if the array or any of its elements are null
    • anyOf

      @Contract(pure=true) @SafeVarargs public static <T> CompletableFuture<T> anyOf(CompletionStage<? extends T>... cfs)
      Returns a new CompletableFuture that is completed when any of the given stages complete, with the same result. Otherwise, if it completed exceptionally, the returned CompletableFuture also does so, with a CompletionException holding this exception as its cause. If no stages are provided, returns an incomplete CompletableFuture.

      This method is the same as CompletableFuture.anyOf(CompletableFuture[]), except that the parameter type is more generic CompletionStage instead of CompletableFuture, and the return type is more specific T instead of Object.

      Parameters:
      cfs - the stages
      Returns:
      a new CompletableFuture that is completed with the result or exception from any of the given stages when one completes
      Throws:
      NullPointerException - if the array or any of its elements are null
      See Also:
    • allTupleFastFailOf

      @Contract(pure=true) public static <T1, T2> CompletableFuture<Tuple2<T1,T2>> allTupleFastFailOf(CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2)
      Returns a new CompletableFuture that is successful when the given stages success. If any of the given stages complete exceptionally, then the returned CompletableFuture also does so *without* waiting other incomplete given stages, with a CompletionException holding this exception as its cause.
      Returns:
      a new CompletableFuture that is successful when the given stages success
      Throws:
      NullPointerException - if any of the given stages are null
      See Also:
    • allTupleFastFailOf

      @Contract(pure=true) public static <T1, T2, T3> CompletableFuture<Tuple3<T1,T2,T3>> allTupleFastFailOf(CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3)
      Returns a new CompletableFuture that is successful when the given stages success. If any of the given stages complete exceptionally, then the returned CompletableFuture also does so *without* waiting other incomplete given stages, with a CompletionException holding this exception as its cause.
      Returns:
      a new CompletableFuture that is successful when the given stages success
      Throws:
      NullPointerException - if any of the given stages are null
      See Also:
    • allTupleFastFailOf

      @Contract(pure=true) public static <T1, T2, T3, T4> CompletableFuture<Tuple4<T1,T2,T3,T4>> allTupleFastFailOf(CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3, CompletionStage<? extends T4> cf4)
      Returns a new CompletableFuture that is successful when the given stages success. If any of the given stages complete exceptionally, then the returned CompletableFuture also does so *without* waiting other incomplete given stages, with a CompletionException holding this exception as its cause.
      Returns:
      a new CompletableFuture that is successful when the given stages success
      Throws:
      NullPointerException - if any of the given stages are null
      See Also:
    • allTupleFastFailOf

      @Contract(pure=true) public static <T1, T2, T3, T4, T5> CompletableFuture<Tuple5<T1,T2,T3,T4,T5>> allTupleFastFailOf(CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3, CompletionStage<? extends T4> cf4, CompletionStage<? extends T5> cf5)
      Returns a new CompletableFuture that is successful when the given stages success. If any of the given stages complete exceptionally, then the returned CompletableFuture also does so *without* waiting other incomplete given stages, with a CompletionException holding this exception as its cause.
      Returns:
      a new CompletableFuture that is successful when the given stages success
      Throws:
      NullPointerException - if any of the given stages are null
      See Also:
    • allSuccessTupleOf

      @Contract(pure=true) public static <T1, T2> CompletableFuture<Tuple2<T1,T2>> allSuccessTupleOf(CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2)
      Returns a new CompletableFuture that is successful with the results of the given stages arguments when all the given stages completed; If the given stage complete exceptionally, treat it successful with value valueIfFailed.
      Returns:
      a new CompletableFuture
      Throws:
      NullPointerException - if any of the given stages are null
      See Also:
    • allSuccessTupleOf

      @Contract(pure=true) public static <T1, T2, T3> CompletableFuture<Tuple3<T1,T2,T3>> allSuccessTupleOf(CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3)
      Returns a new CompletableFuture that is successful with the results of the given stages arguments when all the given stages completed; If the given stage complete exceptionally, treat it successful with value valueIfFailed.
      Returns:
      a new CompletableFuture
      Throws:
      NullPointerException - if any of the given stages are null
      See Also:
    • allSuccessTupleOf

      @Contract(pure=true) public static <T1, T2, T3, T4> CompletableFuture<Tuple4<T1,T2,T3,T4>> allSuccessTupleOf(CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3, CompletionStage<? extends T4> cf4)
      Returns a new CompletableFuture that is successful with the results of the given stages arguments when all the given stages completed; If the given stage complete exceptionally, treat it successful with value valueIfFailed.
      Returns:
      a new CompletableFuture
      Throws:
      NullPointerException - if any of the given stages are null
      See Also:
    • allSuccessTupleOf

      @Contract(pure=true) public static <T1, T2, T3, T4, T5> CompletableFuture<Tuple5<T1,T2,T3,T4,T5>> allSuccessTupleOf(CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3, CompletionStage<? extends T4> cf4, CompletionStage<? extends T5> cf5)
      Returns a new CompletableFuture that is successful with the results of the given stages arguments when all the given stages completed; If the given stage complete exceptionally, treat it successful with value valueIfFailed.
      Returns:
      a new CompletableFuture
      Throws:
      NullPointerException - if any of the given stages are null
      See Also:
    • mostSuccessTupleOf

      @Contract(pure=true) public static <T1, T2> CompletableFuture<Tuple2<T1,T2>> mostSuccessTupleOf(long timeout, TimeUnit unit, CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2)
      Returns a new CompletableFuture with the most results in the same order of the given stages arguments in the given time(timeout, aka as many results as possible in the given time).

      If the given stage is successful, its result is the completed value; Otherwise the value null.

      Parameters:
      timeout - how long to wait in units of unit
      unit - a TimeUnit determining how to interpret the timeout parameter
      Returns:
      a new CompletableFuture
      See Also:
    • mostSuccessTupleOf

      @Contract(pure=true) public static <T1, T2> CompletableFuture<Tuple2<T1,T2>> mostSuccessTupleOf(Executor executorWhenTimeout, long timeout, TimeUnit unit, CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2)
      Returns a new CompletableFuture with the most results in the same order of the given stages arguments in the given time(timeout, aka as many results as possible in the given time).

      If the given stage is successful, its result is the completed value; Otherwise the value null.

      Parameters:
      executorWhenTimeout - the async executor when triggered by timeout
      timeout - how long to wait in units of unit
      unit - a TimeUnit determining how to interpret the timeout parameter
      Returns:
      a new CompletableFuture
      See Also:
    • mostSuccessTupleOf

      @Contract(pure=true) public static <T1, T2, T3> CompletableFuture<Tuple3<T1,T2,T3>> mostSuccessTupleOf(long timeout, TimeUnit unit, CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3)
      Returns a new CompletableFuture with the most results in the same order of the given stages arguments in the given time(timeout, aka as many results as possible in the given time).

      If the given stage is successful, its result is the completed value; Otherwise the value null.

      Parameters:
      timeout - how long to wait in units of unit
      unit - a TimeUnit determining how to interpret the timeout parameter
      Returns:
      a new CompletableFuture
      See Also:
    • mostSuccessTupleOf

      @Contract(pure=true) public static <T1, T2, T3> CompletableFuture<Tuple3<T1,T2,T3>> mostSuccessTupleOf(Executor executorWhenTimeout, long timeout, TimeUnit unit, CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3)
      Returns a new CompletableFuture with the most results in the same order of the given stages arguments in the given time(timeout, aka as many results as possible in the given time).

      If the given stage is successful, its result is the completed value; Otherwise the value null.

      Parameters:
      executorWhenTimeout - the async executor when triggered by timeout
      timeout - how long to wait in units of unit
      unit - a TimeUnit determining how to interpret the timeout parameter
      Returns:
      a new CompletableFuture
      See Also:
    • mostSuccessTupleOf

      @Contract(pure=true) public static <T1, T2, T3, T4> CompletableFuture<Tuple4<T1,T2,T3,T4>> mostSuccessTupleOf(long timeout, TimeUnit unit, CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3, CompletionStage<? extends T4> cf4)
      Returns a new CompletableFuture with the most results in the same order of the given stages arguments in the given time(timeout, aka as many results as possible in the given time).

      If the given stage is successful, its result is the completed value; Otherwise the value null.

      Parameters:
      timeout - how long to wait in units of unit
      unit - a TimeUnit determining how to interpret the timeout parameter
      Returns:
      a new CompletableFuture
      See Also:
    • mostSuccessTupleOf

      @Contract(pure=true) public static <T1, T2, T3, T4> CompletableFuture<Tuple4<T1,T2,T3,T4>> mostSuccessTupleOf(Executor executorWhenTimeout, long timeout, TimeUnit unit, CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3, CompletionStage<? extends T4> cf4)
      Returns a new CompletableFuture with the most results in the same order of the given stages arguments in the given time(timeout, aka as many results as possible in the given time).

      If the given stage is successful, its result is the completed value; Otherwise the value null.

      Parameters:
      executorWhenTimeout - the async executor when triggered by timeout
      timeout - how long to wait in units of unit
      unit - a TimeUnit determining how to interpret the timeout parameter
      Returns:
      a new CompletableFuture
      See Also:
    • mostSuccessTupleOf

      @Contract(pure=true) public static <T1, T2, T3, T4, T5> CompletableFuture<Tuple5<T1,T2,T3,T4,T5>> mostSuccessTupleOf(long timeout, TimeUnit unit, CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3, CompletionStage<? extends T4> cf4, CompletionStage<? extends T5> cf5)
      Returns a new CompletableFuture with the most results in the same order of the given stages arguments in the given time(timeout, aka as many results as possible in the given time).

      If the given stage is successful, its result is the completed value; Otherwise the value null.

      Parameters:
      timeout - how long to wait in units of unit
      unit - a TimeUnit determining how to interpret the timeout parameter
      Returns:
      a new CompletableFuture
      See Also:
    • mostSuccessTupleOf

      @Contract(pure=true) public static <T1, T2, T3, T4, T5> CompletableFuture<Tuple5<T1,T2,T3,T4,T5>> mostSuccessTupleOf(Executor executorWhenTimeout, long timeout, TimeUnit unit, CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3, CompletionStage<? extends T4> cf4, CompletionStage<? extends T5> cf5)
      Returns a new CompletableFuture with the most results in the same order of the given stages arguments in the given time(timeout, aka as many results as possible in the given time).

      If the given stage is successful, its result is the completed value; Otherwise the value null.

      Parameters:
      executorWhenTimeout - the async executor when triggered by timeout
      timeout - how long to wait in units of unit
      unit - a TimeUnit determining how to interpret the timeout parameter
      Returns:
      a new CompletableFuture
      See Also:
    • allTupleOf

      @Contract(pure=true) public static <T1, T2> CompletableFuture<Tuple2<T1,T2>> allTupleOf(CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2)
      Returns a new CompletableFuture that is completed when the given stages complete. If any of the given stages complete exceptionally, then the returned CompletableFuture also does so, with a CompletionException holding this exception as its cause.
      Returns:
      a new CompletableFuture that is completed when the given stages complete
      Throws:
      NullPointerException - if any of the given stages are null
      See Also:
    • allTupleOf

      @Contract(pure=true) public static <T1, T2, T3> CompletableFuture<Tuple3<T1,T2,T3>> allTupleOf(CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3)
      Returns a new CompletableFuture that is completed when the given stages complete. If any of the given stages complete exceptionally, then the returned CompletableFuture also does so, with a CompletionException holding this exception as its cause.
      Returns:
      a new CompletableFuture that is completed when the given stages complete
      Throws:
      NullPointerException - if any of the given stages are null
      See Also:
    • allTupleOf

      @Contract(pure=true) public static <T1, T2, T3, T4> CompletableFuture<Tuple4<T1,T2,T3,T4>> allTupleOf(CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3, CompletionStage<? extends T4> cf4)
      Returns a new CompletableFuture that is completed when the given stages complete. If any of the given stages complete exceptionally, then the returned CompletableFuture also does so, with a CompletionException holding this exception as its cause.
      Returns:
      a new CompletableFuture that is completed when the given stages complete
      Throws:
      NullPointerException - if any of the given stages are null
      See Also:
    • allTupleOf

      @Contract(pure=true) public static <T1, T2, T3, T4, T5> CompletableFuture<Tuple5<T1,T2,T3,T4,T5>> allTupleOf(CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3, CompletionStage<? extends T4> cf4, CompletionStage<? extends T5> cf5)
      Returns a new CompletableFuture that is completed when the given stages complete. If any of the given stages complete exceptionally, then the returned CompletableFuture also does so, with a CompletionException holding this exception as its cause.
      Returns:
      a new CompletableFuture that is completed when the given stages complete
      Throws:
      NullPointerException - if any of the given stages are null
      See Also:
    • failedFuture

      @Contract(pure=true) public static <T> CompletableFuture<T> failedFuture(Throwable ex)
      Returns a new CompletableFuture that is already completed exceptionally with the given exception.
      Type Parameters:
      T - the type of the value
      Parameters:
      ex - the exception
      Returns:
      the exceptionally completed CompletableFuture
    • completedStage

      @Contract(pure=true) public static <T> CompletionStage<T> completedStage(@Nullable T value)
      Returns a new CompletionStage that is already completed with the given value and supports only those methods in interface CompletionStage.

      CAUTION:
      if run on old Java 8(not support *minimal* CompletionStage), just return a *normal* CompletableFuture which is NOT with a *minimal* CompletionStage.

      Type Parameters:
      T - the type of the value
      Parameters:
      value - the value
      Returns:
      the completed CompletionStage
    • failedStage

      @Contract(pure=true) public static <T> CompletionStage<T> failedStage(Throwable ex)
      Returns a new CompletionStage that is already completed exceptionally with the given exception and supports only those methods in interface CompletionStage.

      CAUTION:
      if run on old Java 8(not support *minimal* CompletionStage), just return a *normal* CompletableFuture which is NOT with a *minimal* CompletionStage.

      Type Parameters:
      T - the type of the value
      Parameters:
      ex - the exception
      Returns:
      the exceptionally completed CompletionStage
    • delayedExecutor

      @Contract(pure=true) public static Executor delayedExecutor(long delay, TimeUnit unit)
      Returns a new Executor that submits a task to the default executor after the given delay (or no delay if non-positive). Each delay commences upon invocation of the returned executor's execute method.
      Parameters:
      delay - how long to delay, in units of unit
      unit - a TimeUnit determining how to interpret the delay parameter
      Returns:
      the new delayed executor
    • delayedExecutor

      @Contract(pure=true) public static Executor delayedExecutor(long delay, TimeUnit unit, Executor executor)
      Returns a new Executor that submits a task to the given base executor after the given delay (or no delay if non-positive). Each delay commences upon invocation of the returned executor's execute method.
      Parameters:
      delay - how long to delay, in units of unit
      unit - a TimeUnit determining how to interpret the delay parameter
      executor - the base executor
      Returns:
      the new delayed executor
    • defaultExecutor

      @Contract(pure=true) public static Executor defaultExecutor()
      Returns the default Executor used for async methods that do not specify an Executor. This class uses the ForkJoinPool.commonPool() if it supports more than one parallel thread, or else an Executor using one thread per async task.
      CAUTION: This executor may be not suitable for common biz use(io intensive).
    • thenMApplyFastFailAsync

      @SafeVarargs public static <T, U> CompletableFuture<List<U>> thenMApplyFastFailAsync(CompletableFuture<? extends T> cfThis, Function<? super T,? extends U>... fns)
      Returns a new CompletableFuture that, when the given stage completes normally, is executed using the CompletableFuture's default asynchronous execution facility, with the values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the same order of the given Functions arguments.
      Type Parameters:
      U - the functions' return type
      Parameters:
      fns - the functions to use to compute the values of the returned CompletableFuture
      Returns:
      the new CompletableFuture
    • thenMApplyFastFailAsync

      @SafeVarargs public static <T, U> CompletableFuture<List<U>> thenMApplyFastFailAsync(CompletableFuture<? extends T> cfThis, Executor executor, Function<? super T,? extends U>... fns)
      Returns a new CompletableFuture that, when the given stage completes normally, is executed using the given Executor, with the values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the same order of the given Functions arguments.
      Type Parameters:
      U - the functions' return type
      Parameters:
      executor - the executor to use for asynchronous execution
      fns - the functions to use to compute the values of the returned CompletableFuture
      Returns:
      the new CompletableFuture
    • thenMApplyAllSuccessAsync

      @SafeVarargs public static <T, U> CompletableFuture<List<U>> thenMApplyAllSuccessAsync(CompletableFuture<? extends T> cfThis, @Nullable U valueIfFailed, Function<? super T,? extends U>... fns)
      Returns a new CompletableFuture that, when the given stage completes normally, is executed in the CompletableFuture's default asynchronous execution facility with the successful values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the same order of the given Functions arguments.

      If the given Functions failed, use the given valueIfFailed.

      Type Parameters:
      U - the functions' return type
      Parameters:
      valueIfFailed - the value to return if not completed successfully
      fns - the functions to use to compute the values of the returned CompletableFuture
      Returns:
      the new CompletableFuture
    • thenMApplyAllSuccessAsync

      @SafeVarargs public static <T, U> CompletableFuture<List<U>> thenMApplyAllSuccessAsync(CompletableFuture<? extends T> cfThis, @Nullable U valueIfFailed, Executor executor, Function<? super T,? extends U>... fns)
      Returns a new CompletableFuture that, when the given stage completes normally, is executed in the given Executor with the successful values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the same order of the given Functions arguments.

      If the given Functions failed, use the given valueIfFailed.

      Type Parameters:
      U - the functions' return type
      Parameters:
      valueIfFailed - the value to return if not completed successfully
      fns - the functions to use to compute the values of the returned CompletableFuture
      Returns:
      the new CompletableFuture
    • thenMApplyMostSuccessAsync

      @SafeVarargs public static <T, U> CompletableFuture<List<U>> thenMApplyMostSuccessAsync(CompletableFuture<? extends T> cfThis, @Nullable U valueIfNotSuccess, long timeout, TimeUnit unit, Function<? super T,? extends U>... fns)
      Returns a new CompletableFuture that, when the given stage completes normally, is executed using the CompletableFuture's default asynchronous execution facility, with the most values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the given time(timeout, aka as many results as possible in the given time) in the same order of the given Functions arguments.

      If the given function is successful in the given time, the return result is the completed value; Otherwise the given valueIfNotSuccess.

      Type Parameters:
      U - the functions' return type
      Parameters:
      valueIfNotSuccess - the value to return if not completed successfully
      timeout - how long to wait in units of unit
      unit - a TimeUnit determining how to interpret the timeout parameter
      fns - the functions to use to compute the values of the returned CompletableFuture
      Returns:
      the new CompletableFuture
    • thenMApplyMostSuccessAsync

      @SafeVarargs public static <T, U> CompletableFuture<List<U>> thenMApplyMostSuccessAsync(CompletableFuture<? extends T> cfThis, @Nullable U valueIfNotSuccess, Executor executor, long timeout, TimeUnit unit, Function<? super T,? extends U>... fns)
      Returns a new CompletableFuture that, when the given stage completes normally, is executed using the given Executor, with the most values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the given time(timeout, aka as many results as possible in the given time) in the same order of the given Functions arguments.

      If the given function is successful in the given time, the return result is the completed value; Otherwise the given valueIfNotSuccess.

      Type Parameters:
      U - the functions' return type
      Parameters:
      valueIfNotSuccess - the value to return if not completed successfully
      executor - the executor to use for asynchronous execution
      timeout - how long to wait in units of unit
      unit - a TimeUnit determining how to interpret the timeout parameter
      fns - the functions to use to compute the values of the returned CompletableFuture
      Returns:
      the new CompletableFuture
    • thenMApplyAsync

      @SafeVarargs public static <T, U> CompletableFuture<List<U>> thenMApplyAsync(CompletableFuture<? extends T> cfThis, Function<? super T,? extends U>... fns)
      Returns a new CompletableFuture that, when the given stage completes normally, is executed using the CompletableFuture's default asynchronous execution facility, with the values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the same order of the given Functions arguments.
      Type Parameters:
      U - the functions' return type
      Parameters:
      fns - the functions to use to compute the values of the returned CompletableFuture
      Returns:
      the new CompletableFuture
    • thenMApplyAsync

      @SafeVarargs public static <T, U> CompletableFuture<List<U>> thenMApplyAsync(CompletableFuture<? extends T> cfThis, Executor executor, Function<? super T,? extends U>... fns)
      Returns a new CompletableFuture that, when the given stage completes normally, is executed using the given Executor, with the values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the same order of the given Functions arguments.
      Type Parameters:
      U - the functions' return type
      Parameters:
      executor - the executor to use for asynchronous execution
      fns - the functions to use to compute the values of the returned CompletableFuture
      Returns:
      the new CompletableFuture
    • thenMApplyAnySuccessAsync

      @SafeVarargs public static <T, U> CompletableFuture<U> thenMApplyAnySuccessAsync(CompletableFuture<? extends T> cfThis, Function<? super T,? extends U>... fns)
      Returns a new CompletableFuture that, when the given stage completes normally, is executed using the CompletableFuture's default asynchronous execution facility, with any successful value obtained by calling the given Functions (with the given stage's result as the argument to the given functions).
      Type Parameters:
      U - the functions' return type
      Parameters:
      fns - the functions to use to compute the values of the returned CompletableFuture
      Returns:
      the new CompletableFuture
    • thenMApplyAnySuccessAsync

      @SafeVarargs public static <T, U> CompletableFuture<U> thenMApplyAnySuccessAsync(CompletableFuture<? extends T> cfThis, Executor executor, Function<? super T,? extends U>... fns)
      Returns a new CompletableFuture that, when the given stage completes normally, is executed using the given Executor, with any successful value obtained by calling the given Functions (with the given stage's result as the argument to the given functions).
      Type Parameters:
      U - the functions' return type
      Parameters:
      executor - the executor to use for asynchronous execution
      fns - the functions to use to compute the values of the returned CompletableFuture
      Returns:
      the new CompletableFuture
    • thenMApplyAnyAsync

      @SafeVarargs public static <T, U> CompletableFuture<U> thenMApplyAnyAsync(CompletableFuture<? extends T> cfThis, Function<? super T,? extends U>... fns)
      Returns a new CompletableFuture that, when the given stage completes normally, is executed using the CompletableFuture's default asynchronous execution facility, with any completed result obtained by calling the given Functions (with the given stage's result as the argument to the given functions).
      Type Parameters:
      U - the functions' return type
      Parameters:
      fns - the functions to use to compute the values of the returned CompletableFuture
      Returns:
      the new CompletableFuture
    • thenMApplyAnyAsync

      @SafeVarargs public static <T, U> CompletableFuture<U> thenMApplyAnyAsync(CompletableFuture<? extends T> cfThis, Executor executor, Function<? super T,? extends U>... fns)
      Returns a new CompletableFuture that, when the given stage completes normally, is executed using the given Executor, with any completed result obtained by calling the given Functions (with the given stage's result as the argument to the given functions).
      Type Parameters:
      U - the functions' return type
      Parameters:
      executor - the executor to use for asynchronous execution
      fns - the functions to use to compute the values of the returned CompletableFuture
      Returns:
      the new CompletableFuture
    • thenMAcceptFastFailAsync

      @SafeVarargs public static <T> CompletableFuture<Void> thenMAcceptFastFailAsync(CompletableFuture<? extends T> cfThis, Consumer<? super T>... actions)
      Returns a new CompletableFuture that, when the given stage completes normally, is executed using the CompletableFuture's default asynchronous execution facility, with the given stage's result as the argument to the given actions.
      Parameters:
      actions - the actions to perform before completing the returned CompletableFuture
      Returns:
      the new CompletableFuture
    • thenMAcceptFastFailAsync

      @SafeVarargs public static <T> CompletableFuture<Void> thenMAcceptFastFailAsync(CompletableFuture<? extends T> cfThis, Executor executor, Consumer<? super T>... actions)
      Returns a new CompletableFuture that, when the given stage completes normally, is executed using the given Executor, with the given stage's result as the argument to the given actions.
      Parameters:
      executor - the executor to use for asynchronous execution
      actions - the actions to perform before completing the returned CompletableFuture
      Returns:
      the new CompletableFuture
    • thenMAcceptAsync

      @SafeVarargs public static <T> CompletableFuture<Void> thenMAcceptAsync(CompletableFuture<? extends T> cfThis, Consumer<? super T>... actions)
      Returns a new CompletableFuture that, when the given stage completes normally, is executed using the CompletableFuture's default asynchronous execution facility, with the given stage's result as the argument to the given actions.
      Parameters:
      actions - the actions to perform before completing the returned CompletableFuture
      Returns:
      the new CompletableFuture
    • thenMAcceptAsync

      @SafeVarargs public static <T> CompletableFuture<Void> thenMAcceptAsync(CompletableFuture<? extends T> cfThis, Executor executor, Consumer<? super T>... actions)
      Returns a new CompletableFuture that, when the given stage completes normally, is executed using the given Executor, with the given stage's result as the argument to the given actions.
      Parameters:
      executor - the executor to use for asynchronous execution
      actions - the actions to perform before completing the returned CompletableFuture
      Returns:
      the new CompletableFuture
    • thenMAcceptAnySuccessAsync

      @SafeVarargs public static <T> CompletableFuture<Void> thenMAcceptAnySuccessAsync(CompletableFuture<? extends T> cfThis, Consumer<? super T>... actions)
      Returns a new CompletableFuture that, when the given stage completes normally, is executed using the CompletableFuture's default asynchronous execution facility, with the given stage's result as the argument to the given actions.
      Parameters:
      actions - the actions to perform before completing the returned CompletableFuture
      Returns:
      the new CompletableFuture
    • thenMAcceptAnySuccessAsync

      @SafeVarargs public static <T> CompletableFuture<Void> thenMAcceptAnySuccessAsync(CompletableFuture<? extends T> cfThis, Executor executor, Consumer<? super T>... actions)
      Returns a new CompletableFuture that, when the given stage completes normally, is executed using the given Executor, with the given stage's result as the argument to the given actions.
      Parameters:
      executor - the executor to use for asynchronous execution
      actions - the actions to perform before completing the returned CompletableFuture
      Returns:
      the new CompletableFuture
    • thenMAcceptAnyAsync

      @SafeVarargs public static <T> CompletableFuture<Void> thenMAcceptAnyAsync(CompletableFuture<? extends T> cfThis, Consumer<? super T>... actions)
      Returns a new CompletableFuture that, when the given stage completes normally, is executed using the CompletableFuture's default asynchronous execution facility, with the given stage's result as the argument to the given actions.
      Parameters:
      actions - the actions to perform before completing the returned CompletableFuture
      Returns:
      the new CompletableFuture
    • thenMAcceptAnyAsync

      @SafeVarargs public static <T> CompletableFuture<Void> thenMAcceptAnyAsync(CompletableFuture<? extends T> cfThis, Executor executor, Consumer<? super T>... actions)
      Returns a new CompletableFuture that, when the given stage completes normally, is executed using the given Executor, with the given stage's result as the argument to the given actions.
      Parameters:
      executor - the executor to use for asynchronous execution
      actions - the actions to perform before completing the returned CompletableFuture
      Returns:
      the new CompletableFuture
    • thenMRunFastFailAsync

      public static CompletableFuture<Void> thenMRunFastFailAsync(CompletableFuture<?> cfThis, Runnable... actions)
      Returns a new CompletableFuture that, when the given stage completes normally, executes the given actions using the CompletableFuture's default asynchronous execution facility.
      Parameters:
      actions - the actions to perform before completing the returned CompletableFuture
      Returns:
      the new CompletableFuture
      See Also:
    • thenMRunFastFailAsync

      public static CompletableFuture<Void> thenMRunFastFailAsync(CompletableFuture<?> cfThis, Executor executor, Runnable... actions)
      Returns a new CompletableFuture that, when the given stage completes normally, executes the given actions using the given Executor.
      Parameters:
      executor - the executor to use for asynchronous execution
      actions - the actions to perform before completing the returned CompletableFuture
      Returns:
      the new CompletableFuture
      See Also:
    • thenMRunAsync

      public static CompletableFuture<Void> thenMRunAsync(CompletableFuture<?> cfThis, Runnable... actions)
      Returns a new CompletableFuture that, when the given stage completes normally, executes the given actions using the CompletableFuture's default asynchronous execution facility.
      Parameters:
      actions - the actions to perform before completing the returned CompletableFuture
      Returns:
      the new CompletableFuture
      See Also:
    • thenMRunAsync

      public static CompletableFuture<Void> thenMRunAsync(CompletableFuture<?> cfThis, Executor executor, Runnable... actions)
      Returns a new CompletableFuture that, when the given stage completes normally, executes the given actions using the given Executor.
      Parameters:
      executor - the executor to use for asynchronous execution
      actions - the actions to perform before completing the returned CompletableFuture
      Returns:
      the new CompletableFuture
      See Also:
    • thenMRunAnySuccessAsync

      public static CompletableFuture<Void> thenMRunAnySuccessAsync(CompletableFuture<?> cfThis, Runnable... actions)
      Returns a new CompletableFuture that, when the given stage completes normally, executes the given actions using the CompletableFuture's default asynchronous execution facility.
      Parameters:
      actions - the actions to perform before completing the returned CompletableFuture
      Returns:
      the new CompletableFuture
      See Also:
    • thenMRunAnySuccessAsync

      public static CompletableFuture<Void> thenMRunAnySuccessAsync(CompletableFuture<?> cfThis, Executor executor, Runnable... actions)
      Returns a new CompletableFuture that, when the given stage completes normally, executes the given actions using the given Executor.
      Parameters:
      executor - the executor to use for asynchronous execution
      actions - the actions to perform before completing the returned CompletableFuture
      Returns:
      the new CompletableFuture
      See Also:
    • thenMRunAnyAsync

      public static CompletableFuture<Void> thenMRunAnyAsync(CompletableFuture<?> cfThis, Runnable... actions)
      Returns a new CompletableFuture that, when the given stage completes normally, executes the given actions using the CompletableFuture's default asynchronous execution facility.
      Parameters:
      actions - the actions to perform before completing the returned CompletableFuture
      Returns:
      the new CompletableFuture
      See Also:
    • thenMRunAnyAsync

      public static CompletableFuture<Void> thenMRunAnyAsync(CompletableFuture<?> cfThis, Executor executor, Runnable... actions)
      Returns a new CompletableFuture that, when the given stage completes normally, executes the given actions using the given Executor.
      Parameters:
      executor - the executor to use for asynchronous execution
      actions - the actions to perform before completing the returned CompletableFuture
      Returns:
      the new CompletableFuture
      See Also:
    • thenTupleMApplyFastFailAsync

      public static <T, U1, U2> CompletableFuture<Tuple2<U1,U2>> thenTupleMApplyFastFailAsync(CompletableFuture<? extends T> cfThis, Function<? super T,? extends U1> fn1, Function<? super T,? extends U2> fn2)
      Returns a new CompletableFuture that, when the given stage completes normally, is executed using the CompletableFuture's default asynchronous execution facility, with the values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the same order of the given Functions arguments.
      Returns:
      the new CompletableFuture
    • thenTupleMApplyFastFailAsync

      public static <T, U1, U2> CompletableFuture<Tuple2<U1,U2>> thenTupleMApplyFastFailAsync(CompletableFuture<? extends T> cfThis, Executor executor, Function<? super T,? extends U1> fn1, Function<? super T,? extends U2> fn2)
      Returns a new CompletableFuture that, when the given stage completes normally, is executed using the given Executor, with the values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the same order of the given Functions arguments.
      Parameters:
      executor - the executor to use for asynchronous execution
      Returns:
      the new CompletableFuture
    • thenTupleMApplyFastFailAsync

      public static <T, U1, U2, U3> CompletableFuture<Tuple3<U1,U2,U3>> thenTupleMApplyFastFailAsync(CompletableFuture<? extends T> cfThis, Function<? super T,? extends U1> fn1, Function<? super T,? extends U2> fn2, Function<? super T,? extends U3> fn3)
      Returns a new CompletableFuture that, when the given stage completes normally, is executed using the CompletableFuture's default asynchronous execution facility, with the values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the same order of the given Functions arguments.
      Returns:
      the new CompletableFuture
    • thenTupleMApplyFastFailAsync

      public static <T, U1, U2, U3> CompletableFuture<Tuple3<U1,U2,U3>> thenTupleMApplyFastFailAsync(CompletableFuture<? extends T> cfThis, Executor executor, Function<? super T,? extends U1> fn1, Function<? super T,? extends U2> fn2, Function<? super T,? extends U3> fn3)
      Returns a new CompletableFuture that, when the given stage completes normally, is executed using the given Executor, with the values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the same order of the given Functions arguments.
      Parameters:
      executor - the executor to use for asynchronous execution
      Returns:
      the new CompletableFuture
    • thenTupleMApplyFastFailAsync

      public static <T, U1, U2, U3, U4> CompletableFuture<Tuple4<U1,U2,U3,U4>> thenTupleMApplyFastFailAsync(CompletableFuture<? extends T> cfThis, Function<? super T,? extends U1> fn1, Function<? super T,? extends U2> fn2, Function<? super T,? extends U3> fn3, Function<? super T,? extends U4> fn4)
      Returns a new CompletableFuture that, when the given stage completes normally, is executed using the CompletableFuture's default asynchronous execution facility, with the values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the same order of the given Functions arguments.
      Returns:
      the new CompletableFuture
    • thenTupleMApplyFastFailAsync

      public static <T, U1, U2, U3, U4> CompletableFuture<Tuple4<U1,U2,U3,U4>> thenTupleMApplyFastFailAsync(CompletableFuture<? extends T> cfThis, Executor executor, Function<? super T,? extends U1> fn1, Function<? super T,? extends U2> fn2, Function<? super T,? extends U3> fn3, Function<? super T,? extends U4> fn4)
      Returns a new CompletableFuture that, when the given stage completes normally, is executed using the given Executor, with the values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the same order of the given Functions arguments.
      Parameters:
      executor - the executor to use for asynchronous execution
      Returns:
      the new CompletableFuture
    • thenTupleMApplyFastFailAsync

      public static <T, U1, U2, U3, U4, U5> CompletableFuture<Tuple5<U1,U2,U3,U4,U5>> thenTupleMApplyFastFailAsync(CompletableFuture<? extends T> cfThis, Function<? super T,? extends U1> fn1, Function<? super T,? extends U2> fn2, Function<? super T,? extends U3> fn3, Function<? super T,? extends U4> fn4, Function<? super T,? extends U5> fn5)
      Returns a new CompletableFuture that, when the given stage completes normally, is executed using the CompletableFuture's default asynchronous execution facility, with the values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the same order of the given Functions arguments.
      Returns:
      the new CompletableFuture
    • thenTupleMApplyFastFailAsync

      public static <T, U1, U2, U3, U4, U5> CompletableFuture<Tuple5<U1,U2,U3,U4,U5>> thenTupleMApplyFastFailAsync(CompletableFuture<? extends T> cfThis, Executor executor, Function<? super T,? extends U1> fn1, Function<? super T,? extends U2> fn2, Function<? super T,? extends U3> fn3, Function<? super T,? extends U4> fn4, Function<? super T,? extends U5> fn5)
      Returns a new CompletableFuture that, when the given stage completes normally, is executed using the given Executor, with the values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the same order of the given Functions arguments.
      Parameters:
      executor - the executor to use for asynchronous execution
      Returns:
      the new CompletableFuture
    • thenTupleMApplyAllSuccessAsync

      public static <T, U1, U2> CompletableFuture<Tuple2<U1,U2>> thenTupleMApplyAllSuccessAsync(CompletableFuture<? extends T> cfThis, Function<? super T,? extends U1> fn1, Function<? super T,? extends U2> fn2)
      Returns a new CompletableFuture that, when the given stage completes normally, is executed in the CompletableFuture's default asynchronous execution facility with the successful values obtained by calling the given Functions (with the given stage's result as the argument to the given functions).

      If the given Functions failed, use null.

      Returns:
      the new CompletableFuture
    • thenTupleMApplyAllSuccessAsync

      public static <T, U1, U2> CompletableFuture<Tuple2<U1,U2>> thenTupleMApplyAllSuccessAsync(CompletableFuture<? extends T> cfThis, Executor executor, Function<? super T,? extends U1> fn1, Function<? super T,? extends U2> fn2)
      Returns a new CompletableFuture that, when the given stage completes normally, is executed in the given Executor with the successful values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the same order of the given Functions arguments.

      If the given Functions failed, use null.

      Parameters:
      executor - the executor to use for asynchronous execution
      Returns:
      the new CompletableFuture
    • thenTupleMApplyAllSuccessAsync

      public static <T, U1, U2, U3> CompletableFuture<Tuple3<U1,U2,U3>> thenTupleMApplyAllSuccessAsync(CompletableFuture<? extends T> cfThis, Function<? super T,? extends U1> fn1, Function<? super T,? extends U2> fn2, Function<? super T,? extends U3> fn3)
      Returns a new CompletableFuture that, when the given stage completes normally, is executed in the CompletableFuture's default asynchronous execution facility with the successful values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the same order of the given Functions arguments.

      If the given Functions failed, use null.

      Returns:
      the new CompletableFuture
    • thenTupleMApplyAllSuccessAsync

      public static <T, U1, U2, U3> CompletableFuture<Tuple3<U1,U2,U3>> thenTupleMApplyAllSuccessAsync(CompletableFuture<? extends T> cfThis, Executor executor, Function<? super T,? extends U1> fn1, Function<? super T,? extends U2> fn2, Function<? super T,? extends U3> fn3)
      Returns a new CompletableFuture that, when the given stage completes normally, is executed in the given Executor with the successful values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the same order of the given Functions arguments.

      If the given Functions failed, use null.

      Parameters:
      executor - the executor to use for asynchronous execution
      Returns:
      the new CompletableFuture
    • thenTupleMApplyAllSuccessAsync

      public static <T, U1, U2, U3, U4> CompletableFuture<Tuple4<U1,U2,U3,U4>> thenTupleMApplyAllSuccessAsync(CompletableFuture<? extends T> cfThis, Function<? super T,? extends U1> fn1, Function<? super T,? extends U2> fn2, Function<? super T,? extends U3> fn3, Function<? super T,? extends U4> fn4)
      Returns a new CompletableFuture that, when the given stage completes normally, is executed in the CompletableFuture's default asynchronous execution facility with the successful values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the same order of the given Functions arguments.

      If the given Functions failed, use null.

      Returns:
      the new CompletableFuture
    • thenTupleMApplyAllSuccessAsync

      public static <T, U1, U2, U3, U4> CompletableFuture<Tuple4<U1,U2,U3,U4>> thenTupleMApplyAllSuccessAsync(CompletableFuture<? extends T> cfThis, Executor executor, Function<? super T,? extends U1> fn1, Function<? super T,? extends U2> fn2, Function<? super T,? extends U3> fn3, Function<? super T,? extends U4> fn4)
      Returns a new CompletableFuture that, when the given stage completes normally, is executed in the given Executor with the successful values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the same order of the given Functions arguments.

      If the given Functions failed, use null.

      Parameters:
      executor - the executor to use for asynchronous execution
      Returns:
      the new CompletableFuture
    • thenTupleMApplyAllSuccessAsync

      public static <T, U1, U2, U3, U4, U5> CompletableFuture<Tuple5<U1,U2,U3,U4,U5>> thenTupleMApplyAllSuccessAsync(CompletableFuture<? extends T> cfThis, Function<? super T,? extends U1> fn1, Function<? super T,? extends U2> fn2, Function<? super T,? extends U3> fn3, Function<? super T,? extends U4> fn4, Function<? super T,? extends U5> fn5)
      Returns a new CompletableFuture that, when the given stage completes normally, is executed in the CompletableFuture's default asynchronous execution facility with the successful values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the same order of the given Functions arguments.

      If the given Functions failed, use null.

      Returns:
      the new CompletableFuture
    • thenTupleMApplyAllSuccessAsync

      public static <T, U1, U2, U3, U4, U5> CompletableFuture<Tuple5<U1,U2,U3,U4,U5>> thenTupleMApplyAllSuccessAsync(CompletableFuture<? extends T> cfThis, Executor executor, Function<? super T,? extends U1> fn1, Function<? super T,? extends U2> fn2, Function<? super T,? extends U3> fn3, Function<? super T,? extends U4> fn4, Function<? super T,? extends U5> fn5)
      Returns a new CompletableFuture that, when the given stage completes normally, is executed in the given Executor with the successful values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the same order of the given Functions arguments.

      If the given Functions failed, use null.

      Parameters:
      executor - the executor to use for asynchronous execution
      Returns:
      the new CompletableFuture
    • thenTupleMApplyMostSuccessAsync

      public static <T, U1, U2> CompletableFuture<Tuple2<U1,U2>> thenTupleMApplyMostSuccessAsync(CompletableFuture<? extends T> cfThis, long timeout, TimeUnit unit, Function<? super T,? extends U1> fn1, Function<? super T,? extends U2> fn2)
      Returns a new CompletableFuture that, when the given stage completes normally, is executed using the CompletableFuture's default asynchronous execution facility, with the most values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the given time(timeout, aka as many results as possible in the given time) in the same order of the given Functions arguments.

      If the given function is successful in the given time, the return result is the completed value; Otherwise the given valueIfNotSuccess.

      Parameters:
      timeout - how long to wait in units of unit
      unit - a TimeUnit determining how to interpret the timeout parameter
      Returns:
      the new CompletableFuture
    • thenTupleMApplyMostSuccessAsync

      public static <T, U1, U2> CompletableFuture<Tuple2<U1,U2>> thenTupleMApplyMostSuccessAsync(CompletableFuture<? extends T> cfThis, Executor executor, long timeout, TimeUnit unit, Function<? super T,? extends U1> fn1, Function<? super T,? extends U2> fn2)
      Returns a new CompletableFuture that, when the given stage completes normally, is executed using the given Executor, with the most values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the given time(timeout, aka as many results as possible in the given time) in the same order of the given Functions arguments.

      If the given function is successful in the given time, the return result is the completed value; Otherwise the given valueIfNotSuccess.

      Parameters:
      executor - the executor to use for asynchronous execution
      timeout - how long to wait in units of unit
      unit - a TimeUnit determining how to interpret the timeout parameter
      Returns:
      the new CompletableFuture
    • thenTupleMApplyMostSuccessAsync

      public static <T, U1, U2, U3> CompletableFuture<Tuple3<U1,U2,U3>> thenTupleMApplyMostSuccessAsync(CompletableFuture<? extends T> cfThis, long timeout, TimeUnit unit, Function<? super T,? extends U1> fn1, Function<? super T,? extends U2> fn2, Function<? super T,? extends U3> fn3)
      Returns a new CompletableFuture that, when the given stage completes normally, is executed using the CompletableFuture's default asynchronous execution facility, with the most values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the given time(timeout, aka as many results as possible in the given time) in the same order of the given Functions arguments.

      If the given function is successful in the given time, the return result is the completed value; Otherwise the given valueIfNotSuccess.

      Parameters:
      timeout - how long to wait in units of unit
      unit - a TimeUnit determining how to interpret the timeout parameter
      Returns:
      the new CompletableFuture
    • thenTupleMApplyMostSuccessAsync

      public static <T, U1, U2, U3> CompletableFuture<Tuple3<U1,U2,U3>> thenTupleMApplyMostSuccessAsync(CompletableFuture<? extends T> cfThis, Executor executor, long timeout, TimeUnit unit, Function<? super T,? extends U1> fn1, Function<? super T,? extends U2> fn2, Function<? super T,? extends U3> fn3)
      Returns a new CompletableFuture that, when the given stage completes normally, is executed using the given Executor, with the most values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the given time(timeout, aka as many results as possible in the given time) in the same order of the given Functions arguments.

      If the given function is successful in the given time, the return result is the completed value; Otherwise the given valueIfNotSuccess.

      Parameters:
      executor - the executor to use for asynchronous execution
      timeout - how long to wait in units of unit
      unit - a TimeUnit determining how to interpret the timeout parameter
      Returns:
      the new CompletableFuture
    • thenTupleMApplyMostSuccessAsync

      public static <T, U1, U2, U3, U4> CompletableFuture<Tuple4<U1,U2,U3,U4>> thenTupleMApplyMostSuccessAsync(CompletableFuture<? extends T> cfThis, long timeout, TimeUnit unit, Function<? super T,? extends U1> fn1, Function<? super T,? extends U2> fn2, Function<? super T,? extends U3> fn3, Function<? super T,? extends U4> fn4)
      Returns a new CompletableFuture that, when the given stage completes normally, is executed using the CompletableFuture's default asynchronous execution facility, with the most values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the given time(timeout, aka as many results as possible in the given time) in the same order of the given Functions arguments.

      If the given function is successful in the given time, the return result is the completed value; Otherwise the given valueIfNotSuccess.

      Parameters:
      timeout - how long to wait in units of unit
      unit - a TimeUnit determining how to interpret the timeout parameter
      Returns:
      the new CompletableFuture
    • thenTupleMApplyMostSuccessAsync

      public static <T, U1, U2, U3, U4> CompletableFuture<Tuple4<U1,U2,U3,U4>> thenTupleMApplyMostSuccessAsync(CompletableFuture<? extends T> cfThis, Executor executor, long timeout, TimeUnit unit, Function<? super T,? extends U1> fn1, Function<? super T,? extends U2> fn2, Function<? super T,? extends U3> fn3, Function<? super T,? extends U4> fn4)
      Returns a new CompletableFuture that, when the given stage completes normally, is executed using the given Executor, with the most values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the given time(timeout, aka as many results as possible in the given time) in the same order of the given Functions arguments.

      If the given function is successful in the given time, the return result is the completed value; Otherwise the given valueIfNotSuccess.

      Parameters:
      executor - the executor to use for asynchronous execution
      timeout - how long to wait in units of unit
      unit - a TimeUnit determining how to interpret the timeout parameter
      Returns:
      the new CompletableFuture
    • thenTupleMApplyMostSuccessAsync

      public static <T, U1, U2, U3, U4, U5> CompletableFuture<Tuple5<U1,U2,U3,U4,U5>> thenTupleMApplyMostSuccessAsync(CompletableFuture<? extends T> cfThis, long timeout, TimeUnit unit, Function<? super T,? extends U1> fn1, Function<? super T,? extends U2> fn2, Function<? super T,? extends U3> fn3, Function<? super T,? extends U4> fn4, Function<? super T,? extends U5> fn5)
      Returns a new CompletableFuture that, when the given stage completes normally, is executed using the CompletableFuture's default asynchronous execution facility, with the most values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the given time(timeout, aka as many results as possible in the given time) in the same order of the given Functions arguments.

      If the given function is successful in the given time, the return result is the completed value; Otherwise the given valueIfNotSuccess.

      Parameters:
      timeout - how long to wait in units of unit
      unit - a TimeUnit determining how to interpret the timeout parameter
      Returns:
      the new CompletableFuture
    • thenTupleMApplyMostSuccessAsync

      public static <T, U1, U2, U3, U4, U5> CompletableFuture<Tuple5<U1,U2,U3,U4,U5>> thenTupleMApplyMostSuccessAsync(CompletableFuture<? extends T> cfThis, Executor executor, long timeout, TimeUnit unit, Function<? super T,? extends U1> fn1, Function<? super T,? extends U2> fn2, Function<? super T,? extends U3> fn3, Function<? super T,? extends U4> fn4, Function<? super T,? extends U5> fn5)
      Returns a new CompletableFuture that, when the given stage completes normally, is executed using the given Executor, with the most values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the given time(timeout, aka as many results as possible in the given time) in the same order of the given Functions arguments.

      If the given function is successful in the given time, the return result is the completed value; Otherwise the given valueIfNotSuccess.

      Parameters:
      executor - the executor to use for asynchronous execution
      timeout - how long to wait in units of unit
      unit - a TimeUnit determining how to interpret the timeout parameter
      Returns:
      the new CompletableFuture
    • thenTupleMApplyAsync

      public static <T, U1, U2> CompletableFuture<Tuple2<U1,U2>> thenTupleMApplyAsync(CompletableFuture<? extends T> cfThis, Function<? super T,? extends U1> fn1, Function<? super T,? extends U2> fn2)
      Returns a new CompletableFuture that, when the given stage completes normally, is executed using the CompletableFuture's default asynchronous execution facility, with the values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the same order of the given Functions arguments.
      Returns:
      the new CompletableFuture
    • thenTupleMApplyAsync

      public static <T, U1, U2> CompletableFuture<Tuple2<U1,U2>> thenTupleMApplyAsync(CompletableFuture<? extends T> cfThis, Executor executor, Function<? super T,? extends U1> fn1, Function<? super T,? extends U2> fn2)
      Returns a new CompletableFuture that, when the given stage completes normally, is executed using the given Executor, with the values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the same order of the given Functions arguments.
      Parameters:
      executor - the executor to use for asynchronous execution
      Returns:
      the new CompletableFuture
    • thenTupleMApplyAsync

      public static <T, U1, U2, U3> CompletableFuture<Tuple3<U1,U2,U3>> thenTupleMApplyAsync(CompletableFuture<? extends T> cfThis, Function<? super T,? extends U1> fn1, Function<? super T,? extends U2> fn2, Function<? super T,? extends U3> fn3)
      Returns a new CompletableFuture that, when the given stage completes normally, is executed using the CompletableFuture's default asynchronous execution facility, with the values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the same order of the given Functions arguments.
      Returns:
      the new CompletableFuture
    • thenTupleMApplyAsync

      public static <T, U1, U2, U3> CompletableFuture<Tuple3<U1,U2,U3>> thenTupleMApplyAsync(CompletableFuture<? extends T> cfThis, Executor executor, Function<? super T,? extends U1> fn1, Function<? super T,? extends U2> fn2, Function<? super T,? extends U3> fn3)
      Returns a new CompletableFuture that, when the given stage completes normally, is executed using the given Executor, with the values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the same order of the given Functions arguments.
      Parameters:
      executor - the executor to use for asynchronous execution
      Returns:
      the new CompletableFuture
    • thenTupleMApplyAsync

      public static <T, U1, U2, U3, U4> CompletableFuture<Tuple4<U1,U2,U3,U4>> thenTupleMApplyAsync(CompletableFuture<? extends T> cfThis, Function<? super T,? extends U1> fn1, Function<? super T,? extends U2> fn2, Function<? super T,? extends U3> fn3, Function<? super T,? extends U4> fn4)
      Returns a new CompletableFuture that, when the given stage completes normally, is executed using the CompletableFuture's default asynchronous execution facility, with the values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the same order of the given Functions arguments.
      Returns:
      the new CompletableFuture
    • thenTupleMApplyAsync

      public static <T, U1, U2, U3, U4> CompletableFuture<Tuple4<U1,U2,U3,U4>> thenTupleMApplyAsync(CompletableFuture<? extends T> cfThis, Executor executor, Function<? super T,? extends U1> fn1, Function<? super T,? extends U2> fn2, Function<? super T,? extends U3> fn3, Function<? super T,? extends U4> fn4)
      Returns a new CompletableFuture that, when the given stage completes normally, is executed using the given Executor, with the values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the same order of the given Functions arguments.
      Parameters:
      executor - the executor to use for asynchronous execution
      Returns:
      the new CompletableFuture
    • thenTupleMApplyAsync

      public static <T, U1, U2, U3, U4, U5> CompletableFuture<Tuple5<U1,U2,U3,U4,U5>> thenTupleMApplyAsync(CompletableFuture<? extends T> cfThis, Function<? super T,? extends U1> fn1, Function<? super T,? extends U2> fn2, Function<? super T,? extends U3> fn3, Function<? super T,? extends U4> fn4, Function<? super T,? extends U5> fn5)
      Returns a new CompletableFuture that, when the given stage completes normally, is executed using the CompletableFuture's default asynchronous execution facility, with the values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the same order of the given Functions arguments.
      Returns:
      the new CompletableFuture
    • thenTupleMApplyAsync

      public static <T, U1, U2, U3, U4, U5> CompletableFuture<Tuple5<U1,U2,U3,U4,U5>> thenTupleMApplyAsync(CompletableFuture<? extends T> cfThis, Executor executor, Function<? super T,? extends U1> fn1, Function<? super T,? extends U2> fn2, Function<? super T,? extends U3> fn3, Function<? super T,? extends U4> fn4, Function<? super T,? extends U5> fn5)
      Returns a new CompletableFuture that, when the given stage completes normally, is executed using the given Executor, with the values obtained by calling the given Functions (with the given stage's result as the argument to the given functions) in the same order of the given Functions arguments.
      Parameters:
      executor - the executor to use for asynchronous execution
      Returns:
      the new CompletableFuture
    • thenCombineFastFail

      public static <T, U, V> CompletableFuture<V> thenCombineFastFail(CompletableFuture<? extends T> cfThis, CompletionStage<? extends U> other, BiFunction<? super T,? super U,? extends V> fn)
      Returns a new CompletableFuture that, when tow given stage both complete normally, is executed with the two results as arguments to the supplied function. if any of the given stage complete exceptionally, then the returned CompletableFuture also does so *without* waiting other incomplete given CompletionStage, with a CompletionException holding this exception as its cause.
      Parameters:
      fn - the function to use to compute the value of the returned CompletableFuture
      Returns:
      the new CompletableFuture
    • thenCombineFastFailAsync

      public static <T, U, V> CompletableFuture<V> thenCombineFastFailAsync(CompletableFuture<? extends T> cfThis, CompletionStage<? extends U> other, BiFunction<? super T,? super U,? extends V> fn)
      Returns a new CompletableFuture that, when tow given stage both complete normally, is executed using CompletableFuture's default asynchronous execution facility, with the two results as arguments to the supplied function. if any of the given stage complete exceptionally, then the returned CompletableFuture also does so *without* waiting other incomplete given CompletionStage, with a CompletionException holding this exception as its cause.
      Parameters:
      fn - the function to use to compute the value of the returned CompletableFuture
      Returns:
      the new CompletableFuture
    • thenCombineFastFailAsync

      public static <T, U, V> CompletableFuture<V> thenCombineFastFailAsync(CompletableFuture<? extends T> cfThis, CompletionStage<? extends U> other, BiFunction<? super T,? super U,? extends V> fn, Executor executor)
      Returns a new CompletableFuture that, when tow given stage both complete normally, is executed using the supplied executor, with the two results as arguments to the supplied function. if any of the given stage complete exceptionally, then the returned CompletableFuture also does so *without* waiting other incomplete given CompletionStage, with a CompletionException holding this exception as its cause.
      Parameters:
      fn - the function to use to compute the value of the returned CompletableFuture
      Returns:
      the new CompletableFuture
    • thenAcceptBothFastFail

      public static <T, U> CompletableFuture<Void> thenAcceptBothFastFail(CompletableFuture<? extends T> cfThis, CompletionStage<? extends U> other, BiConsumer<? super T,? super U> action)
      Returns a new CompletableFuture that, when tow given stage both complete normally, is executed with the two results as arguments to the supplied action. if any of the given stage complete exceptionally, then the returned CompletableFuture also does so *without* waiting other incomplete given CompletionStage, with a CompletionException holding this exception as its cause.
      Parameters:
      action - the action to perform before completing the returned CompletableFuture
      Returns:
      the new CompletableFuture
    • thenAcceptBothFastFailAsync

      public static <T, U> CompletableFuture<Void> thenAcceptBothFastFailAsync(CompletableFuture<? extends T> cfThis, CompletionStage<? extends U> other, BiConsumer<? super T,? super U> action)
      Returns a new CompletableFuture that, when tow given stage both complete normally, is executed using CompletableFuture's default asynchronous execution facility, with the two results as arguments to the supplied action. if any of the given stage complete exceptionally, then the returned CompletableFuture also does so *without* waiting other incomplete given CompletionStage, with a CompletionException holding this exception as its cause.
      Parameters:
      action - the action to perform before completing the returned CompletableFuture
      Returns:
      the new CompletableFuture
    • thenAcceptBothFastFailAsync

      public static <T, U> CompletableFuture<Void> thenAcceptBothFastFailAsync(CompletableFuture<? extends T> cfThis, CompletionStage<? extends U> other, BiConsumer<? super T,? super U> action, Executor executor)
      Returns a new CompletableFuture that, when tow given stage both complete normally, is executed using the supplied executor, with the two results as arguments to the supplied action. if any of the given stage complete exceptionally, then the returned CompletableFuture also does so *without* waiting other incomplete given CompletionStage, with a CompletionException holding this exception as its cause.
      Parameters:
      action - the action to perform before completing the returned CompletableFuture
      Returns:
      the new CompletableFuture
    • runAfterBothFastFail

      public static CompletableFuture<Void> runAfterBothFastFail(CompletableFuture<?> cfThis, CompletionStage<?> other, Runnable action)
      Returns a new CompletableFuture that, when two given stages both complete normally, executes the given action. if any of the given stage complete exceptionally, then the returned CompletableFuture also does so *without* waiting other incomplete given CompletionStage, with a CompletionException holding this exception as its cause.
      Parameters:
      action - the action to perform before completing the returned CompletableFuture
      Returns:
      the new CompletableFuture
    • runAfterBothFastFailAsync

      public static CompletableFuture<Void> runAfterBothFastFailAsync(CompletableFuture<?> cfThis, CompletionStage<?> other, Runnable action)
      Returns a new CompletableFuture that, when two given stages both complete normally, executes the given action using CompletableFuture's default asynchronous execution facility. if any of the given stage complete exceptionally, then the returned CompletableFuture also does so *without* waiting other incomplete given CompletionStage, with a CompletionException holding this exception as its cause.
      Parameters:
      action - the action to perform before completing the returned CompletableFuture
      Returns:
      the new CompletableFuture
    • runAfterBothFastFailAsync

      public static CompletableFuture<Void> runAfterBothFastFailAsync(CompletableFuture<?> cfThis, CompletionStage<?> other, Runnable action, Executor executor)
      Returns a new CompletableFuture that, when two given stages both complete normally, executes the given action using the supplied executor. if any of the given stage complete exceptionally, then the returned CompletableFuture also does so *without* waiting other incomplete given CompletionStage, with a CompletionException holding this exception as its cause.
      Parameters:
      action - the action to perform before completing the returned CompletableFuture
      Returns:
      the new CompletableFuture
    • applyToEitherSuccess

      public static <T, U> CompletableFuture<U> applyToEitherSuccess(CompletableFuture<? extends T> cfThis, CompletionStage<? extends T> other, Function<? super T,? extends U> fn)
      Returns a new CompletableFuture that, when either given stage success, is executed with the corresponding result as argument to the supplied function.
      Type Parameters:
      U - the function's return type
      Parameters:
      fn - the function to use to compute the value of the returned CompletableFuture
      Returns:
      the new CompletableFuture
    • applyToEitherSuccessAsync

      public static <T, U> CompletableFuture<U> applyToEitherSuccessAsync(CompletableFuture<? extends T> cfThis, CompletionStage<? extends T> other, Function<? super T,? extends U> fn)
      Returns a new CompletableFuture that, when either given stage success, is executed using this CompletableFuture's default asynchronous execution facility, with the corresponding result as argument to the supplied function.
      Type Parameters:
      U - the function's return type
      Parameters:
      fn - the function to use to compute the value of the returned CompletableFuture
      Returns:
      the new CompletableFuture
    • applyToEitherSuccessAsync

      public static <T, U> CompletableFuture<U> applyToEitherSuccessAsync(CompletableFuture<? extends T> cfThis, CompletionStage<? extends T> other, Function<? super T,? extends U> fn, Executor executor)
      Returns a new CompletableFuture that, when either given stage success, is executed using the supplied executor, with the corresponding result as argument to the supplied function.
      Type Parameters:
      U - the function's return type
      Parameters:
      fn - the function to use to compute the value of the returned CompletableFuture
      executor - the executor to use for asynchronous execution
      Returns:
      the new CompletableFuture
    • acceptEitherSuccess

      public static <T> CompletableFuture<Void> acceptEitherSuccess(CompletableFuture<? extends T> cfThis, CompletionStage<? extends T> other, Consumer<? super T> action)
      Returns a new CompletableFuture that, when either given stage success, is executed with the corresponding result as argument to the supplied action.
      Parameters:
      action - the action to perform before completing the returned CompletableFuture
      Returns:
      the new CompletableFuture
    • acceptEitherSuccessAsync

      public static <T> CompletableFuture<Void> acceptEitherSuccessAsync(CompletableFuture<? extends T> cfThis, CompletionStage<? extends T> other, Consumer<? super T> action)
      Returns a new CompletableFuture that, when either given stage success, is executed using this CompletableFuture's default asynchronous execution facility, with the corresponding result as argument to the supplied action.
      Parameters:
      action - the action to perform before completing the returned CompletableFuture
      Returns:
      the new CompletableFuture
    • acceptEitherSuccessAsync

      public static <T> CompletableFuture<Void> acceptEitherSuccessAsync(CompletableFuture<? extends T> cfThis, CompletionStage<? extends T> other, Consumer<? super T> action, Executor executor)
      Returns a new CompletableFuture that, when either given stage success, is executed using the supplied executor, with the corresponding result as argument to the supplied action.
      Parameters:
      action - the action to perform before completing the returned CompletableFuture
      executor - the executor to use for asynchronous execution
      Returns:
      the new CompletableFuture
    • runAfterEitherSuccess

      public static CompletableFuture<Void> runAfterEitherSuccess(CompletableFuture<?> cfThis, CompletionStage<?> other, Runnable action)
      Returns a new CompletableFuture that, when either given stage success, executes the given action. Otherwise, all two given CompletionStage complete exceptionally, the returned CompletableFuture also does so, with a CompletionException holding an exception from any of the given CompletionStage as its cause.
      Parameters:
      action - the action to perform before completing the returned CompletableFuture
      Returns:
      the new CompletableFuture
    • runAfterEitherSuccessAsync

      public static CompletableFuture<Void> runAfterEitherSuccessAsync(CompletableFuture<?> cfThis, CompletionStage<?> other, Runnable action)
      Returns a new CompletableFuture that, when either given stage success, executes the given action using CompletableFuture's default asynchronous execution facility. Otherwise, all two given CompletionStage complete exceptionally, the returned CompletableFuture also does so, with a CompletionException holding an exception from any of the given CompletionStage as its cause.
      Parameters:
      action - the action to perform before completing the returned CompletableFuture
      Returns:
      the new CompletableFuture
    • runAfterEitherSuccessAsync

      public static CompletableFuture<Void> runAfterEitherSuccessAsync(CompletableFuture<?> cfThis, CompletionStage<?> other, Runnable action, Executor executor)
      Returns a new CompletableFuture that, when either given stage success, executes the given action using the supplied executor. Otherwise, all two given CompletionStage complete exceptionally, the returned CompletableFuture also does so, with a CompletionException holding an exception from any of the given CompletionStage as its cause.
      Parameters:
      action - the action to perform before completing the returned CompletableFuture
      Returns:
      the new CompletableFuture
    • catching

      public static <T, X extends Throwable, C extends CompletionStage<? super T>> C catching(C cfThis, Class<X> exceptionType, Function<? super X,? extends T> fallback)
      Returns a new CompletionStage that, when given stage completes exceptionally with the given exceptionType, is executed with given stage's exception as the argument to the supplied function. Otherwise, the returned stage contains same result as input CompletionStage.
      Parameters:
      exceptionType - the exception type that triggers use of fallback. The exception type is matched against the input's exception. To avoid hiding bugs and other unrecoverable errors, callers should prefer more specific types, avoiding Throwable.class in particular.
      fallback - the Function to be called if input fails with the expected exception type. The function's argument is the input's exception.
      See Also:
    • catchingAsync

      public static <T, X extends Throwable, C extends CompletionStage<? super T>> C catchingAsync(C cfThis, Class<X> exceptionType, Function<? super X,? extends T> fallback)
      Returns a new CompletionStage that, when given stage completes exceptionally with the given exceptionType, is executed with given stage's exception as the argument to the supplied function, using the given stage's default asynchronous execution facility. Otherwise, the returned stage contains same result as input CompletionStage.
      Parameters:
      exceptionType - the exception type that triggers use of fallback. The exception type is matched against the input's exception. To avoid hiding bugs and other unrecoverable errors, callers should prefer more specific types, avoiding Throwable.class in particular.
      fallback - the Function to be called if input fails with the expected exception type. The function's argument is the input's exception.
      See Also:
    • catchingAsync

      public static <T, X extends Throwable, C extends CompletionStage<? super T>> C catchingAsync(C cfThis, Class<X> exceptionType, Function<? super X,? extends T> fallback, Executor executor)
      Returns a new CompletionStage that, when given stage completes exceptionally with the given exceptionType, is executed with given stage's exception as the argument to the supplied function, using the supplied Executor. Otherwise, the returned stage contains same result as input CompletionStage.
      Parameters:
      exceptionType - the exception type that triggers use of fallback. The exception type is matched against the input's exception. To avoid hiding bugs and other unrecoverable errors, callers should prefer more specific types, avoiding Throwable.class in particular.
      fallback - the Function to be called if input fails with the expected exception type. The function's argument is the input's exception.
      executor - the executor to use for asynchronous execution
      See Also:
    • exceptionallyAsync

      public static <T, C extends CompletionStage<? super T>> C exceptionallyAsync(C cfThis, Function<Throwable,? extends T> fn)
      Returns a new CompletionStage that, when given stage completes exceptionally, is executed with given stage's exception as the argument to the supplied function, using given stage's default asynchronous execution facility. Otherwise, if given stage completes normally, then the returned stage also completes normally with the same value.
      Parameters:
      fn - the function to use to compute the value of the returned CompletableFuture if given CompletionStage completed exceptionally
      Returns:
      the new CompletableFuture
    • exceptionallyAsync

      public static <T, C extends CompletionStage<? super T>> C exceptionallyAsync(C cfThis, Function<Throwable,? extends T> fn, Executor executor)
      Returns a new CompletionStage that, when given stage completes exceptionally, is executed with given stage's exception as the argument to the supplied function, using the supplied Executor. Otherwise, if given stage completes normally, then the returned stage also completes normally with the same value.
      Parameters:
      fn - the function to use to compute the value of the returned CompletableFuture if given CompletionStage completed exceptionally
      executor - the executor to use for asynchronous execution
      Returns:
      the new CompletableFuture
    • cffuOrTimeout

      public static <C extends CompletableFuture<?>> C cffuOrTimeout(C cfThis, long timeout, TimeUnit unit)
      Exceptionally completes given CompletableFuture with a TimeoutException if not otherwise completed before the given timeout.

      Uses CompletableFuture's default asynchronous execution facility as executorWhenTimeout.

      Parameters:
      timeout - how long to wait before completing exceptionally with a TimeoutException, in units of unit
      unit - a TimeUnit determining how to interpret the timeout parameter
      Returns:
      the new CompletableFuture
      See Also:
    • cffuOrTimeout

      public static <C extends CompletableFuture<?>> C cffuOrTimeout(C cfThis, Executor executorWhenTimeout, long timeout, TimeUnit unit)
      Exceptionally completes given CompletableFuture with a TimeoutException if not otherwise completed before the given timeout.
      Parameters:
      executorWhenTimeout - the async executor when triggered by timeout
      timeout - how long to wait before completing exceptionally with a TimeoutException, in units of unit
      unit - a TimeUnit determining how to interpret the timeout parameter
      Returns:
      the new CompletableFuture
    • orTimeout

      @Contract("_, _, _ -> param1") public static <C extends CompletableFuture<?>> C orTimeout(C cfThis, long timeout, TimeUnit unit)
      Exceptionally completes given CompletableFuture with a TimeoutException if not otherwise completed before the given timeout.

      CAUTION: This method and CompletableFuture.orTimeout(long, TimeUnit) is UNSAFE!

      When triggered by timeout, the subsequent non-async actions of the dependent CompletableFutures are performed in the SINGLE thread builtin executor of CompletableFuture for delay execution (including timeout function). So the long-running subsequent non-async actions lead to the CompletableFuture dysfunction (including delay execution and timeout).

      Strong recommend using the safe method cffuOrTimeout(CompletableFuture, long, TimeUnit) instead of this method and CompletableFuture.orTimeout(long, TimeUnit).

      Unless all subsequent actions of dependent CompletableFutures is ensured executing async (aka. the dependent CompletableFutures is created by async methods), using this method and CompletableFuture.orTimeout(long, TimeUnit) is one less thread switch of task execution when triggered by timeout.

      Parameters:
      timeout - how long to wait before completing exceptionally with a TimeoutException, in units of unit
      unit - a TimeUnit determining how to interpret the timeout parameter
      Returns:
      the given CompletableFuture
      See Also:
    • cffuCompleteOnTimeout

      public static <T, C extends CompletableFuture<? super T>> C cffuCompleteOnTimeout(C cfThis, @Nullable T value, long timeout, TimeUnit unit)
      Completes given CompletableFuture with the given value if not otherwise completed before the given timeout.

      Uses CompletableFuture's default asynchronous execution facility as executorWhenTimeout.

      Parameters:
      value - the value to use upon timeout
      timeout - how long to wait before completing normally with the given value, in units of unit
      unit - a TimeUnit determining how to interpret the timeout parameter
      Returns:
      the new CompletableFuture
      See Also:
    • cffuCompleteOnTimeout

      public static <T, C extends CompletableFuture<? super T>> C cffuCompleteOnTimeout(C cfThis, @Nullable T value, Executor executorWhenTimeout, long timeout, TimeUnit unit)
      Completes given CompletableFuture with the given value if not otherwise completed before the given timeout.
      Parameters:
      value - the value to use upon timeout
      executorWhenTimeout - the async executor when triggered by timeout
      timeout - how long to wait before completing normally with the given value, in units of unit
      unit - a TimeUnit determining how to interpret the timeout parameter
      Returns:
      the new CompletableFuture
    • completeOnTimeout

      @Contract("_, _, _, _ -> param1") public static <T, C extends CompletableFuture<? super T>> C completeOnTimeout(C cfThis, @Nullable T value, long timeout, TimeUnit unit)
      Completes given CompletableFuture with the given value if not otherwise completed before the given timeout.

      CAUTION: This method and CompletableFuture.completeOnTimeout(Object, long, TimeUnit) is UNSAFE!

      When triggered by timeout, the subsequent non-async actions of the dependent CompletableFutures are performed in the SINGLE thread builtin executor of CompletableFuture for delay execution (including timeout function). So the long-running subsequent non-async actions lead to the CompletableFuture dysfunction (including delay execution and timeout).

      Strong recommend using the safe method cffuCompleteOnTimeout(CompletableFuture, Object, long, TimeUnit) instead of this method and CompletableFuture.completeOnTimeout(Object, long, TimeUnit).

      Unless all subsequent actions of dependent CompletableFutures is ensured executing async (aka. the dependent CompletableFutures is created by async methods), using this method and CompletableFuture.completeOnTimeout(Object, long, TimeUnit) is one less thread switch of task execution when triggered by timeout.

      Parameters:
      value - the value to use upon timeout
      timeout - how long to wait before completing normally with the given value, in units of unit
      unit - a TimeUnit determining how to interpret the timeout parameter
      Returns:
      the given CompletableFuture
      See Also:
    • catchingCompose

      public static <T, X extends Throwable, C extends CompletionStage<? super T>> C catchingCompose(C cfThis, Class<X> exceptionType, Function<? super X,? extends CompletionStage<T>> fallback)
      Returns a new CompletionStage that, when given stage completes exceptionally with the given exceptionType, is composed using the results of the supplied function applied to given stage's exception.
      Parameters:
      exceptionType - the exception type that triggers use of fallback. The exception type is matched against the input's exception. To avoid hiding bugs and other unrecoverable errors, callers should prefer more specific types, avoiding Throwable.class in particular.
      fallback - the Function to be called if input fails with the expected exception type. The function's argument is the input's exception.
      See Also:
    • catchingComposeAsync

      public static <T, X extends Throwable, C extends CompletionStage<? super T>> C catchingComposeAsync(C cfThis, Class<X> exceptionType, Function<? super X,? extends CompletionStage<T>> fallback)
      Returns a new CompletionStage that, when given stage completes exceptionally with the given exceptionType, is composed using the results of the supplied function applied to given stage's exception, using given stage's default asynchronous execution facility.
      Parameters:
      exceptionType - the exception type that triggers use of fallback. The exception type is matched against the input's exception. To avoid hiding bugs and other unrecoverable errors, callers should prefer more specific types, avoiding Throwable.class in particular.
      fallback - the Function to be called if input fails with the expected exception type. The function's argument is the input's exception.
      See Also:
    • catchingComposeAsync

      public static <T, X extends Throwable, C extends CompletionStage<? super T>> C catchingComposeAsync(C cfThis, Class<X> exceptionType, Function<? super X,? extends CompletionStage<T>> fallback, Executor executor)
      Returns a new CompletionStage that, when given stage completes exceptionally with the given exceptionType, is composed using the results of the supplied function applied to given's exception, using the supplied Executor.
      Parameters:
      exceptionType - the exception type that triggers use of fallback. The exception type is matched against the input's exception. To avoid hiding bugs and other unrecoverable errors, callers should prefer more specific types, avoiding Throwable.class in particular.
      fallback - the Function to be called if input fails with the expected exception type. The function's argument is the input's exception.
      executor - the executor to use for asynchronous execution
      See Also:
    • exceptionallyCompose

      public static <T, C extends CompletionStage<? super T>> C exceptionallyCompose(C cfThis, Function<Throwable,? extends CompletionStage<T>> fn)
      Returns a new CompletableFuture that, when given CompletableFuture completes exceptionally, is composed using the results of the supplied function applied to given stage's exception.
      Parameters:
      fn - the function to use to compute the returned CompletableFuture if given CompletionStage completed exceptionally
      Returns:
      the new CompletableFuture
    • exceptionallyComposeAsync

      public static <T, C extends CompletionStage<? super T>> C exceptionallyComposeAsync(C cfThis, Function<Throwable,? extends CompletionStage<T>> fn)
      Returns a new CompletableFuture that, when given CompletableFuture completes exceptionally, is composed using the results of the supplied function applied to given stage's exception, using given CompletableFuture's default asynchronous execution facility.
      Parameters:
      fn - the function to use to compute the returned CompletableFuture if given CompletionStage completed exceptionally
      Returns:
      the new CompletableFuture
    • exceptionallyComposeAsync

      public static <T, C extends CompletionStage<? super T>> C exceptionallyComposeAsync(C cfThis, Function<Throwable,? extends CompletionStage<T>> fn, Executor executor)
      Returns a new CompletableFuture that, when given CompletableFuture completes exceptionally, is composed using the results of the supplied function applied to given stage's exception, using the supplied Executor.
      Parameters:
      fn - the function to use to compute the returned CompletableFuture if given CompletionStage completed exceptionally
      executor - the executor to use for asynchronous execution
      Returns:
      the new CompletableFuture
    • peek

      @Contract("_, _ -> param1") public static <T, C extends CompletionStage<? extends T>> C peek(C cfThis, BiConsumer<? super T,? super Throwable> action)
      Peeks the result by executing the given action when given stage completes, returns the given stage.

      When the given stage is complete, the given action is invoked with the result (or null if none) and the exception (or null if none) of given stage as arguments. Whether the supplied action throws an exception or not, the given stage is NOT affected.

      Unlike method handle and like method whenComplete, this method is not designed to translate completion outcomes.

      Parameters:
      action - the action to perform
      Returns:
      the given stage
      See Also:
    • peekAsync

      @Contract("_, _ -> param1") public static <T, C extends CompletionStage<? extends T>> C peekAsync(C cfThis, BiConsumer<? super T,? super Throwable> action)
      Peeks the result by executing the given action when given stage completes, executes the given action using given stage's default asynchronous execution facility, returns the given stage.

      When the given stage is complete, the given action is invoked with the result (or null if none) and the exception (or null if none) of given stage as arguments. Whether the supplied action throws an exception or not, the given stage is NOT affected.

      Unlike method handle and like method whenComplete, this method is not designed to translate completion outcomes.

      Parameters:
      action - the action to perform
      Returns:
      the given stage
      See Also:
    • peekAsync

      @Contract("_, _, _ -> param1") public static <T, C extends CompletionStage<? extends T>> C peekAsync(C cfThis, BiConsumer<? super T,? super Throwable> action, Executor executor)
      Peeks the result by executing the given action when given stage completes, executes the given action using the supplied Executor, returns the given stage.

      When the given stage is complete, the given action is invoked with the result (or null if none) and the exception (or null if none) of given stage as arguments. Whether the supplied action throws an exception or not, the given stage is NOT affected.

      Unlike method handle and like method whenComplete, this method is not designed to translate completion outcomes.

      Parameters:
      action - the action to perform
      Returns:
      the given stage
      See Also:
    • join

      @Blocking @Nullable public static <T> T join(CompletableFuture<T> cfThis, long timeout, TimeUnit unit)
      Waits if necessary for at most the given time for the computation to complete, and then retrieves its result value when complete, or throws an (unchecked) exception if completed exceptionally.

      NOTE:
      Calling this method

      result = CompletableFutureUtils.join(cf, timeout, unit);

      is the same as:

      result = cf.copy() // defensive copy to avoid writing this cf unexpectedly
           .orTimeout(timeout, unit)
           .join();
       
      CAUTION:
      if the wait timed out, this method throws an (unchecked) CompletionException with the TimeoutException as its cause; NOT throws a (checked) TimeoutException like CompletableFuture.get(long, TimeUnit).
      Parameters:
      timeout - the maximum time to wait
      unit - the time unit of the timeout argument
      Returns:
      the result value
      Throws:
      CancellationException - if the computation was cancelled
      CompletionException - if given future completed exceptionally or a completion computation threw an exception or the wait timed out(with the TimeoutException as its cause)
      See Also:
    • getSuccessNow

      @Contract(pure=true) @Nullable public static <T> T getSuccessNow(CompletableFuture<? extends T> cfThis, @Nullable T valueIfNotSuccess)
      Returns the result value if the given stage is completed successfully, else returns the given valueIfNotSuccess.

      This method will not throw exceptions (CancellationException/CompletionException/ExecutionException/IllegalStateException/...).

      Parameters:
      valueIfNotSuccess - the value to return if not completed successfully
      Returns:
      the result value, if completed successfully, else the given valueIfNotSuccess
    • resultNow

      @Contract(pure=true) @Nullable public static <T> T resultNow(Future<T> cfThis)
      Returns the computed result, without waiting.

      This method is for cases where the caller knows that the task has already completed successfully, for example when filtering a stream of Future objects for the successful tasks and using a mapping operation to obtain a stream of results.

      results = futures.stream()
           .filter(f -> f.state() == Future.State.SUCCESS)
           .map(Future::resultNow)
           .toList();
       
      Returns:
      the computed result
      Throws:
      IllegalStateException - if the task has not completed or the task did not complete with a result
    • exceptionNow

      @Contract(pure=true) public static Throwable exceptionNow(Future<?> cfThis)
      Returns the exception thrown by the task, without waiting.

      This method is for cases where the caller knows that the task has already completed with an exception.

      Returns:
      the exception thrown by the task
      Throws:
      IllegalStateException - if the task has not completed, the task completed normally, or the task was cancelled
    • state

      @Contract(pure=true) public static CffuState state(Future<?> cfThis)
      Returns the computation state(CffuState), this method is equivalent to CompletableFuture.state() with java version compatibility logic, so you can invoke in old java 18-.
      Returns:
      the computation state
      See Also:
    • completeAsync

      @Contract("_, _ -> param1") public static <T, C extends CompletableFuture<? super T>> C completeAsync(C cfThis, Supplier<? extends T> supplier)
      Completes given CompletableFuture with the result of the given Supplier function invoked from an asynchronous task using the default executor.
      Parameters:
      supplier - a function returning the value to be used to complete given CompletableFuture
      Returns:
      the given CompletableFuture
      See Also:
    • completeAsync

      @Contract("_, _, _ -> param1") public static <T, C extends CompletableFuture<? super T>> C completeAsync(C cfThis, Supplier<? extends T> supplier, Executor executor)
      Completes given CompletableFuture with the result of the given Supplier function invoked from an asynchronous task using the given executor.
      Parameters:
      supplier - a function returning the value to be used to complete given CompletableFuture
      executor - the executor to use for asynchronous execution
      Returns:
      the given CompletableFuture
      See Also:
    • completeExceptionallyAsync

      @Contract("_, _ -> param1") public static <C extends CompletableFuture<?>> C completeExceptionallyAsync(C cfThis, Supplier<? extends Throwable> supplier)
      If not already completed, completes given CompletableFuture with the exception result of the given Supplier function invoked from an asynchronous task using the default executor.
      Parameters:
      supplier - a function returning the value to be used to complete given CompletableFuture
      Returns:
      the given CompletableFuture
      See Also:
    • completeExceptionallyAsync

      @Contract("_, _, _ -> param1") public static <C extends CompletableFuture<?>> C completeExceptionallyAsync(C cfThis, Supplier<? extends Throwable> supplier, Executor executor)
      If not already completed, completes given CompletableFuture with the exception result of the given Supplier function invoked from an asynchronous task using the given executor.
      Parameters:
      supplier - a function returning the value to be used to complete given CompletableFuture
      executor - the executor to use for asynchronous execution
      Returns:
      the given CompletableFuture
      See Also:
    • minimalCompletionStage

      @Contract(pure=true) public static <T> CompletionStage<T> minimalCompletionStage(CompletableFuture<T> cfThis)
      Returns a new CompletionStage that is completed normally with the same value as given CompletableFuture when it completes normally, and cannot be independently completed or otherwise used in ways not defined by the methods of interface CompletionStage. If given CompletableFuture completes exceptionally, then the returned CompletionStage completes exceptionally with a CompletionException with given exception as cause.

      CAUTION:
      if run on old Java 8(not support *minimal* CompletionStage), just return a *normal* CompletableFuture which is NOT with a *minimal* CompletionStage.

      Returns:
      the new CompletionStage
      See Also:
    • copy

      @Contract(pure=true) public static <T> CompletableFuture<T> copy(CompletableFuture<T> cfThis)
      Returns a new CompletableFuture that is completed normally with the same value as this CompletableFuture when it completes normally. If this CompletableFuture completes exceptionally, then the returned CompletableFuture completes exceptionally with a CompletionException with this exception as cause. The behavior is equivalent to thenApply(x -> x). This method may be useful as a form of "defensive copying", to prevent clients from completing, while still being able to arrange dependent actions.
      Returns:
      the new CompletableFuture
      See Also:
    • newIncompleteFuture

      @Contract(pure=true) public static <U> CompletableFuture<U> newIncompleteFuture(CompletableFuture<?> cfThis)
      Returns a new incomplete CompletableFuture of the type to be returned by a CompletionStage method.
      Type Parameters:
      U - the type of the value
      Returns:
      the new CompletableFuture
      See Also:
    • toCompletableFutureArray

      @Contract(pure=true) @SafeVarargs public static <T> CompletableFuture<T>[] toCompletableFutureArray(CompletionStage<T>... stages)
      A convenient util method for converting input CompletionStage (including Cffu/CompletableFuture) array element by CompletionStage.toCompletableFuture().
      See Also:
    • completableFutureListToArray

      @Contract(pure=true) public static <T> CompletableFuture<T>[] completableFutureListToArray(List<CompletableFuture<T>> cfList)
      A convenient util method for converting input CompletableFuture list to CompletableFuture array.
      See Also:
    • unwrapCfException

      @Contract(value="null -> null; !null -> !null", pure=true) @Nullable public static Throwable unwrapCfException(@Nullable Throwable ex)
      A convenient util method for unwrapping CF exception (CompletionException/ExecutionException) to the biz exception.