From 414d47944ca18957c052b276e9d1916e927223f6 Mon Sep 17 00:00:00 2001 From: Jerry Lee Date: Thu, 11 Jul 2024 18:57:19 +0800 Subject: [PATCH] feat: implement `allSuccess*` methods in `CffuFactory`/`Cffu` (#197) --- .../src/main/java/io/foldright/cffu/Cffu.java | 163 +++++++++ .../java/io/foldright/cffu/CffuFactory.java | 325 +++++++++++++++++- 2 files changed, 473 insertions(+), 15 deletions(-) diff --git a/cffu-core/src/main/java/io/foldright/cffu/Cffu.java b/cffu-core/src/main/java/io/foldright/cffu/Cffu.java index cb02be89..8e1d7131 100644 --- a/cffu-core/src/main/java/io/foldright/cffu/Cffu.java +++ b/cffu-core/src/main/java/io/foldright/cffu/Cffu.java @@ -244,6 +244,45 @@ public final Cffu> thenMApplyFastFailAsync(Executor executor, Functi return reset0(CompletableFutureUtils.thenMApplyFastFailAsync(cf, executor, fns)); } + /** + * Returns a new Cffu that, when the given stage completes normally, + * is executed in the Cffu'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. + * + * @param valueIfFailed the value to return if not completed successfully + * @param fns the functions to use to compute the values of the returned Cffu + * @param the functions' return type + * @return the new Cffu + */ + @SafeVarargs + public final Cffu> thenMApplyAllSuccessAsync( + @Nullable U valueIfFailed, Function... fns) { + return thenMApplyAllSuccessAsync(valueIfFailed, fac.defaultExecutor(), fns); + } + + /** + * Returns a new Cffu 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. + * + * @param valueIfFailed the value to return if not completed successfully + * @param fns the functions to use to compute the values of the returned Cffu + * @param the functions' return type + * @return the new Cffu + */ + @SafeVarargs + public final Cffu> thenMApplyAllSuccessAsync( + @Nullable U valueIfFailed, Executor executor, Function... fns) { + return reset0(CompletableFutureUtils.thenMApplyAllSuccessAsync(cf, valueIfFailed, executor, fns)); + } + /** * Returns a new Cffu that, when the given stage completes normally, * is executed using {@link #defaultExecutor()}, @@ -702,6 +741,130 @@ public Cffu> thenTupleMApplyFast return reset0(CompletableFutureUtils.thenTupleMApplyFastFailAsync(cf, executor, fn1, fn2, fn3, fn4, fn5)); } + /** + * Returns a new Cffu that, when this Cffu completes normally, is executed using the {@link #defaultExecutor()}, + * 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 {@code null}. + * + * @return the new Cffu + */ + public Cffu> thenTupleMApplyAllSuccessAsync( + Function fn1, Function fn2) { + return thenTupleMApplyAllSuccessAsync(fac.defaultExecutor(), fn1, fn2); + } + + /** + * Returns a new Cffu that, when this Cffu completes normally, is executed using the supplied Executor, + * 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 {@code null}. + * + * @param executor the executor to use for asynchronous execution + * @return the new Cffu + */ + public Cffu> thenTupleMApplyAllSuccessAsync( + Executor executor, Function fn1, Function fn2) { + return reset0(CompletableFutureUtils.thenTupleMApplyAllSuccessAsync(cf, executor, fn1, fn2)); + } + + /** + * Returns a new Cffu that, when this Cffu completes normally, is executed using the {@link #defaultExecutor()}, + * 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 {@code null}. + * + * @return the new Cffu + */ + public Cffu> thenTupleMApplyAllSuccessAsync( + Function fn1, + Function fn2, Function fn3) { + return thenTupleMApplyAllSuccessAsync(fac.defaultExecutor(), fn1, fn2, fn3); + } + + /** + * Returns a new Cffu that, when this Cffu completes normally, is executed using the supplied Executor, + * 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 {@code null}. + * + * @param executor the executor to use for asynchronous execution + * @return the new Cffu + */ + public Cffu> thenTupleMApplyAllSuccessAsync( + Executor executor, Function fn1, + Function fn2, Function fn3) { + return reset0(CompletableFutureUtils.thenTupleMApplyAllSuccessAsync(cf, executor, fn1, fn2, fn3)); + } + + /** + * Returns a new Cffu that, when this Cffu completes normally, is executed using the {@link #defaultExecutor()}, + * 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 {@code null}. + * + * @return the new Cffu + */ + public Cffu> thenTupleMApplyAllSuccessAsync( + Function fn1, Function fn2, + Function fn3, Function fn4) { + return thenTupleMApplyAllSuccessAsync(fac.defaultExecutor(), fn1, fn2, fn3, fn4); + } + + /** + * Returns a new Cffu that, when this Cffu completes normally, is executed using the supplied Executor, + * 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 {@code null}. + * + * @param executor the executor to use for asynchronous execution + * @return the new Cffu + */ + public Cffu> thenTupleMApplyAllSuccessAsync( + Executor executor, Function fn1, Function fn2, + Function fn3, Function fn4) { + return reset0(CompletableFutureUtils.thenTupleMApplyAllSuccessAsync(cf, executor, fn1, fn2, fn3, fn4)); + } + + /** + * Returns a new Cffu that, when this Cffu completes normally, is executed using the {@link #defaultExecutor()}, + * 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 {@code null}. + * + * @return the new Cffu + */ + public Cffu> thenTupleMApplyAllSuccessAsync( + Function fn1, + Function fn2, Function fn3, + Function fn4, Function fn5) { + return thenTupleMApplyAllSuccessAsync(fac.defaultExecutor(), fn1, fn2, fn3, fn4, fn5); + } + + /** + * Returns a new Cffu that, when this Cffu completes normally, is executed using the supplied Executor, + * 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 {@code null}. + * + * @param executor the executor to use for asynchronous execution + * @return the new Cffu + */ + public Cffu> thenTupleMApplyAllSuccessAsync( + Executor executor, Function fn1, + Function fn2, Function fn3, + Function fn4, Function fn5) { + return reset0(CompletableFutureUtils.thenTupleMApplyAllSuccessAsync(cf, executor, fn1, fn2, fn3, fn4, fn5)); + } + /** * Returns a new Cffu that, when this Cffu completes normally, is executed using the {@link #defaultExecutor()}, * with the values obtained by calling the given Functions diff --git a/cffu-core/src/main/java/io/foldright/cffu/CffuFactory.java b/cffu-core/src/main/java/io/foldright/cffu/CffuFactory.java index 233f6de4..c983ff45 100644 --- a/cffu-core/src/main/java/io/foldright/cffu/CffuFactory.java +++ b/cffu-core/src/main/java/io/foldright/cffu/CffuFactory.java @@ -185,6 +185,46 @@ public final Cffu> mSupplyFastFailAsync(Executor executor, Supplier< return create(CompletableFutureUtils.mSupplyFastFailAsync(executor, suppliers)); } + /** + * Returns a new Cffu that is asynchronously completed + * by tasks running in the Cffu'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. + * + * @param valueIfFailed the value to return if not failed + * @param suppliers the suppliers returning the value to be used to complete the returned Cffu + * @param the suppliers' return type + * @return the new Cffu + * @see #allSuccessResultsOf(Object, CompletionStage[]) + */ + @SafeVarargs + public final Cffu> mSupplyAllSuccessAsync( + @Nullable T valueIfFailed, Supplier... suppliers) { + return mSupplyAllSuccessAsync(valueIfFailed, defaultExecutor, suppliers); + } + + /** + * Returns a new Cffu 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. + * + * @param valueIfFailed the value to return if not failed + * @param executor the executor to use for asynchronous execution + * @param suppliers the suppliers returning the value to be used to complete the returned Cffu + * @param the suppliers' return type + * @return the new Cffu + * @see #allSuccessResultsOf(Object, CompletionStage[]) + */ + @SafeVarargs + public final Cffu> mSupplyAllSuccessAsync( + @Nullable T valueIfFailed, Executor executor, Supplier... suppliers) { + return create(CompletableFutureUtils.mSupplyAllSuccessAsync(valueIfFailed, executor, suppliers)); + } + /** * Returns a new Cffu that is asynchronously completed * by tasks running in the Cffu's default asynchronous execution facility @@ -564,9 +604,140 @@ public Cffu> tupleMSupplyFastFai /** * Returns a new Cffu that is asynchronously completed - * by tasks running in the {@link #defaultExecutor()} with the values obtained by calling the given Suppliers + * by tasks running in the Cffu'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 {@code null}. + * + * @return the new Cffu + */ + public Cffu> tupleMSupplyAllSuccessAsync( + Supplier supplier1, Supplier supplier2) { + return tupleMSupplyAllSuccessAsync(defaultExecutor, supplier1, supplier2); + } + + /** + * Returns a new Cffu 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 {@code null}. + * + * @param executor the executor to use for asynchronous execution + * @return the new Cffu + */ + public Cffu> tupleMSupplyAllSuccessAsync( + Executor executor, Supplier supplier1, Supplier supplier2) { + return create(CompletableFutureUtils.tupleMSupplyAllSuccessAsync(executor, supplier1, supplier2)); + } + + /** + * Returns a new Cffu that is asynchronously completed + * by tasks running in the Cffu'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 {@code null}. + * + * @return the new Cffu + */ + public Cffu> tupleMSupplyAllSuccessAsync( + Supplier supplier1, Supplier supplier2, Supplier supplier3) { + return tupleMSupplyAllSuccessAsync(defaultExecutor, supplier1, supplier2, supplier3); + } + + /** + * Returns a new Cffu 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 {@code null}. + * + * @param executor the executor to use for asynchronous execution + * @return the new Cffu + */ + public Cffu> tupleMSupplyAllSuccessAsync( + Executor executor, Supplier supplier1, Supplier supplier2, Supplier supplier3) { + return create(CompletableFutureUtils.tupleMSupplyAllSuccessAsync(executor, supplier1, supplier2, supplier3)); + } + + /** + * Returns a new Cffu that is asynchronously completed + * by tasks running in the Cffu'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 {@code null}. + * + * @return the new Cffu + */ + public Cffu> tupleMSupplyAllSuccessAsync( + Supplier supplier1, Supplier supplier2, + Supplier supplier3, Supplier supplier4) { + return tupleMSupplyAllSuccessAsync(defaultExecutor, supplier1, supplier2, supplier3, supplier4); + } + + /** + * Returns a new Cffu 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 {@code null}. * + * @param executor the executor to use for asynchronous execution + * @return the new Cffu + */ + public Cffu> tupleMSupplyAllSuccessAsync( + Executor executor, Supplier supplier1, Supplier supplier2, + Supplier supplier3, Supplier supplier4) { + return create(CompletableFutureUtils.tupleMSupplyAllSuccessAsync(executor, supplier1, supplier2, supplier3, supplier4)); + } + + /** + * Returns a new Cffu that is asynchronously completed + * by tasks running in the Cffu'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 {@code null}. + * + * @return the new Cffu + */ + public Cffu> tupleMSupplyAllSuccessAsync( + Supplier supplier1, Supplier supplier2, + Supplier supplier3, Supplier supplier4, Supplier supplier5) { + return tupleMSupplyAllSuccessAsync(defaultExecutor, supplier1, supplier2, supplier3, supplier4, supplier5); + } + + /** + * Returns a new Cffu 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 {@code null}. + * + * @param executor the executor to use for asynchronous execution + * @return the new Cffu + */ + public Cffu> tupleMSupplyAllSuccessAsync( + Executor executor, Supplier supplier1, Supplier supplier2, + Supplier supplier3, Supplier supplier4, Supplier supplier5) { + return create(CompletableFutureUtils.tupleMSupplyAllSuccessAsync(executor, supplier1, supplier2, supplier3, supplier4, supplier5)); + } + + /** + * Returns a new Cffu that is asynchronously completed + * by tasks running in the Cffu's default asynchronous execution facility + * with the most values obtained by calling the given Suppliers + * in the given time({@code 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 {@code null}. + * + * @param timeout how long to wait in units of {@code unit} + * @param unit a {@code TimeUnit} determining how to interpret the {@code timeout} parameter * @return the new Cffu */ public Cffu> tupleMSupplyMostSuccessAsync( @@ -575,11 +746,17 @@ public Cffu> tupleMSupplyMostSuccessAsync( } /** - * Returns a new Cffu that is asynchronously completed - * by tasks running in the given Executor with the values obtained by calling the given Suppliers + * Returns a new Cffu 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({@code 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 {@code null}. * * @param executor the executor to use for asynchronous execution + * @param timeout how long to wait in units of {@code unit} + * @param unit a {@code TimeUnit} determining how to interpret the {@code timeout} parameter * @return the new Cffu */ public Cffu> tupleMSupplyMostSuccessAsync( @@ -590,9 +767,16 @@ public Cffu> tupleMSupplyMostSuccessAsync( /** * Returns a new Cffu that is asynchronously completed - * by tasks running in the {@link #defaultExecutor()} with the values obtained by calling the given Suppliers + * by tasks running in the Cffu's default asynchronous execution facility + * with the most values obtained by calling the given Suppliers + * in the given time({@code 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 {@code null}. * + * @param timeout how long to wait in units of {@code unit} + * @param unit a {@code TimeUnit} determining how to interpret the {@code timeout} parameter * @return the new Cffu */ public Cffu> tupleMSupplyMostSuccessAsync( @@ -602,11 +786,17 @@ public Cffu> tupleMSupplyMostSuccessAsync( } /** - * Returns a new Cffu that is asynchronously completed - * by tasks running in the given Executor with the values obtained by calling the given Suppliers + * Returns a new Cffu 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({@code 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 {@code null}. * * @param executor the executor to use for asynchronous execution + * @param timeout how long to wait in units of {@code unit} + * @param unit a {@code TimeUnit} determining how to interpret the {@code timeout} parameter * @return the new Cffu */ public Cffu> tupleMSupplyMostSuccessAsync( @@ -618,9 +808,16 @@ public Cffu> tupleMSupplyMostSuccessAsync( /** * Returns a new Cffu that is asynchronously completed - * by tasks running in the {@link #defaultExecutor()} with the values obtained by calling the given Suppliers + * by tasks running in the Cffu's default asynchronous execution facility + * with the most values obtained by calling the given Suppliers + * in the given time({@code 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 {@code null}. * + * @param timeout how long to wait in units of {@code unit} + * @param unit a {@code TimeUnit} determining how to interpret the {@code timeout} parameter * @return the new Cffu */ public Cffu> tupleMSupplyMostSuccessAsync( @@ -630,11 +827,17 @@ public Cffu> tupleMSupplyMostSuccessAsyn } /** - * Returns a new Cffu that is asynchronously completed - * by tasks running in the given Executor with the values obtained by calling the given Suppliers + * Returns a new Cffu 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({@code 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 {@code null}. * * @param executor the executor to use for asynchronous execution + * @param timeout how long to wait in units of {@code unit} + * @param unit a {@code TimeUnit} determining how to interpret the {@code timeout} parameter * @return the new Cffu */ public Cffu> tupleMSupplyMostSuccessAsync( @@ -646,9 +849,16 @@ public Cffu> tupleMSupplyMostSuccessAsyn /** * Returns a new Cffu that is asynchronously completed - * by tasks running in the {@link #defaultExecutor()} with the values obtained by calling the given Suppliers + * by tasks running in the Cffu's default asynchronous execution facility + * with the most values obtained by calling the given Suppliers + * in the given time({@code 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 {@code null}. * + * @param timeout how long to wait in units of {@code unit} + * @param unit a {@code TimeUnit} determining how to interpret the {@code timeout} parameter * @return the new Cffu */ public Cffu> tupleMSupplyMostSuccessAsync( @@ -658,11 +868,17 @@ public Cffu> tupleMSupplyMostSuc } /** - * Returns a new Cffu that is asynchronously completed - * by tasks running in the given Executor with the values obtained by calling the given Suppliers + * Returns a new Cffu 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({@code 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 {@code null}. * * @param executor the executor to use for asynchronous execution + * @param timeout how long to wait in units of {@code unit} + * @param unit a {@code TimeUnit} determining how to interpret the {@code timeout} parameter * @return the new Cffu */ public Cffu> tupleMSupplyMostSuccessAsync( @@ -810,6 +1026,23 @@ public final Cffu> allResultsFastFailOf(CompletionStage return create(CompletableFutureUtils.allResultsFastFailOf(cfs)); } + /** + * Returns a new Cffu 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 Cffu completed with the value empty list. + * + * @param valueIfFailed the value to return if not completed successfully + * @param cfs the stages + * @throws NullPointerException if the array or any of its elements are {@code null} + */ + @Contract(pure = true) + @SafeVarargs + public final Cffu> allSuccessResultsOf( + @Nullable T valueIfFailed, CompletionStage... cfs) { + return create(CompletableFutureUtils.allSuccessResultsOf(valueIfFailed, cfs)); + } + /** * Returns a new Cffu with the most results in the same order of * the given stages arguments in the given time({@code timeout}, aka as many results as possible in the given time). @@ -817,9 +1050,9 @@ public final Cffu> allResultsFastFailOf(CompletionStage * If the given stage is successful, its result is the completed value; Otherwise the given valueIfNotSuccess. * * @param valueIfNotSuccess the value to return if not completed successfully - * @param timeout how long to wait in units of {@code unit} - * @param unit a {@code TimeUnit} determining how to interpret the {@code timeout} parameter - * @param cfs the stages + * @param timeout how long to wait in units of {@code unit} + * @param unit a {@code TimeUnit} determining how to interpret the {@code timeout} parameter + * @param cfs the stages * @see Cffu#getSuccessNow(Object) */ @Contract(pure = true) @@ -1031,6 +1264,68 @@ public Cffu> allTupleFastFailOf( return create(CompletableFutureUtils.allTupleFastFailOf(cf1, cf2, cf3, cf4, cf5)); } + /** + * Returns a new Cffu 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. + * + * @return a new Cffu + * @throws NullPointerException if any of the given stages are {@code null} + * @see #allSuccessResultsOf(Object, CompletionStage[]) + */ + @Contract(pure = true) + public Cffu> allSuccessTupleOf( + CompletionStage cf1, CompletionStage cf2) { + return create(CompletableFutureUtils.allSuccessTupleOf(cf1, cf2)); + } + + /** + * Returns a new Cffu 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. + * + * @return a new Cffu + * @throws NullPointerException if any of the given stages are {@code null} + * @see #allSuccessResultsOf(Object, CompletionStage[]) + */ + @Contract(pure = true) + public Cffu> allSuccessTupleOf( + CompletionStage cf1, CompletionStage cf2, CompletionStage cf3) { + return create(CompletableFutureUtils.allSuccessTupleOf(cf1, cf2, cf3)); + } + + /** + * Returns a new Cffu 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. + * + * @return a new Cffu + * @throws NullPointerException if any of the given stages are {@code null} + * @see #allSuccessResultsOf(Object, CompletionStage[]) + */ + @Contract(pure = true) + public Cffu> allSuccessTupleOf( + CompletionStage cf1, CompletionStage cf2, + CompletionStage cf3, CompletionStage cf4) { + return create(CompletableFutureUtils.allSuccessTupleOf(cf1, cf2, cf3, cf4)); + } + + /** + * Returns a new Cffu 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. + * + * @return a new Cffu + * @throws NullPointerException if any of the given stages are {@code null} + * @see #allSuccessResultsOf(Object, CompletionStage[]) + */ + @Contract(pure = true) + public Cffu> allSuccessTupleOf( + CompletionStage cf1, CompletionStage cf2, CompletionStage cf3, + CompletionStage cf4, CompletionStage cf5) { + return create(CompletableFutureUtils.allSuccessTupleOf(cf1, cf2, cf3, cf4, cf5)); + } + /** * Returns a new Cffu with the most results in the same order of * the given two stages arguments in the given time({@code timeout}, aka as many results as possible in the given time).