Class CffuFactory
CffuFactory
is equivalent to CompletableFuture
,
contains the static (factory) methods of CompletableFuture
.
The methods that equivalent to the instance methods of CompletableFuture
is in Cffu
class.
Use builder(Executor)
to config and build CffuFactory
.
About factory methods conventions of CffuFactory
:
- factory methods return
Cffu
instead ofCompletableFuture
. - only provide varargs methods for multiply Cffu/CF input arguments;
if you have
List
input, use static util methodscffuListToArray(List)
orCompletableFutureUtils.completableFutureListToArray(List)
to convert it to array first.
- Author:
- Jerry Lee (oldratlee at gmail dot com), HuHao (995483610 at qq dot com)
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionallFastFailOf
(CompletionStage<?>... cfs) Returns a new Cffu that is successful when all the given stages success; If any of the given stages complete exceptionally, then the returned Cffu also does so *without* waiting other incomplete given stages, with a CompletionException holding this exception as its cause.allOf
(CompletionStage<?>... cfs) Returns a new Cffu that is completed when all the given stages complete; If any of the given stages complete exceptionally, then the returned Cffu also does so, with a CompletionException holding this exception as its cause.allResultsFastFailOf
(CompletionStage<? extends T>... 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 success; If any of the given stages complete exceptionally, then the returned Cffu also does so *without* waiting other incomplete given stages, with a CompletionException holding this exception as its cause.allResultsOf
(CompletionStage<? extends T>... cfs) Returns a new Cffu with the results in the same order of the given stages arguments, the new Cffu is completed when all the given stages complete; If any of the given stages complete exceptionally, then the returned Cffu also does so, with a CompletionException holding this exception as its cause.allSuccessResultsOf
(T valueIfFailed, CompletionStage<? extends T>... 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.allSuccessTupleOf
(CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> 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.allSuccessTupleOf
(CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> 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.allSuccessTupleOf
(CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3, CompletionStage<? extends T4> 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.allSuccessTupleOf
(CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3, CompletionStage<? extends T4> cf4, CompletionStage<? extends T5> 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.allTupleFastFailOf
(CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2) Returns a new Cffu that is successful when the given two stages success.allTupleFastFailOf
(CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3) Returns a new Cffu that is successful when the given three stages success.allTupleFastFailOf
(CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3, CompletionStage<? extends T4> cf4) Returns a new Cffu that is successful when the given four stages success.allTupleFastFailOf
(CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3, CompletionStage<? extends T4> cf4, CompletionStage<? extends T5> cf5) Returns a new Cffu that is successful when the given five stages success.allTupleOf
(CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2) Returns a new Cffu that is completed when the given two stages complete.allTupleOf
(CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3) Returns a new Cffu that is completed when the given three stages complete.allTupleOf
(CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3, CompletionStage<? extends T4> cf4) Returns a new Cffu that is completed when the given four stages complete.allTupleOf
(CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3, CompletionStage<? extends T4> cf4, CompletionStage<? extends T5> cf5) Returns a new Cffu that is completed when the given five stages complete.final <T> Cffu
<T> anyOf
(CompletionStage<? extends T>... cfs) Returns a new Cffu that is completed when any of the given stages complete, with the same result.
Otherwise, if it completed exceptionally, the returned Cffu also does so, with a CompletionException holding this exception as its cause.
If no stages are provided, returns an incomplete Cffu.final <T> Cffu
<T> anySuccessOf
(CompletionStage<? extends T>... cfs) Returns a new Cffu that is successful when any of the given stages success, with the same result.static CffuFactoryBuilder
Returns aCffuFactoryBuilder
withdefaultExecutor
setting.static <T> CompletableFuture<T>[]
cffuArrayUnwrap
(Cffu<T>... cfs) A convenient util method for unwrap inputCffu
array elements byCffu.cffuUnwrap()
.static <T> Cffu<T>[]
cffuListToArray
(List<Cffu<T>> cffuList) Convert Cffu list to Cffu array.<T> Cffu
<T> completedFuture
(T value) Returns a new Cffu that is already completed with the given value.<T> CompletionStage
<T> completedStage
(T value) Returns a new CompletionStage that is already completed with the given value and supports only those methods in interfaceCompletionStage
.Returns the default Executor used for async methods that do not specify an 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).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).<T> Cffu
<T> Returns a new Cffu that is already completed exceptionally with the given exception.<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 interfaceCompletionStage
.boolean
ReturnsforbidObtrudeMethods
or not.mostSuccessResultsOf
(T valueIfNotSuccess, long timeout, TimeUnit unit, CompletionStage<? extends T>... cfs) Returns a new Cffu 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).mostSuccessTupleOf
(long timeout, TimeUnit unit, CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2) Returns a new Cffu with the most results in the same order of the given two stages arguments in the given time(timeout
, aka as many results as possible in the given time).mostSuccessTupleOf
(long timeout, TimeUnit unit, CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3) Returns a new Cffu with the most results in the same order of the given three stages arguments in the given time(timeout
, aka as many results as possible in the given time).mostSuccessTupleOf
(long timeout, TimeUnit unit, CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3, CompletionStage<? extends T4> cf4) Returns a new Cffu with the most results in the same order of the given four stages arguments in the given time(timeout
, aka as many results as possible in the given time).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 Cffu with the most results in the same order of the given five stages arguments in the given time(timeout
, aka as many results as possible in the given time).mRunAnyAsync
(Runnable... actions) Returns a new Cffu that is asynchronously completed when any tasks running in the Cffu's default asynchronous execution facility.mRunAnyAsync
(Executor executor, Runnable... actions) Returns a new Cffu that is asynchronously completed when any tasks running in the given executor complete.mRunAnySuccessAsync
(Runnable... actions) Returns a new Cffu that is asynchronously successful when any tasks running in the Cffu's default asynchronous execution facility success.mRunAnySuccessAsync
(Executor executor, Runnable... actions) Returns a new Cffu that is asynchronously completed when any tasks running in the Cffu's default asynchronous execution facility.Returns a new Cffu that is asynchronously completed by tasks running in the Cffu's default asynchronous execution facility after runs the given actions.Returns a new Cffu that is asynchronously completed by tasks running in the given Executor after runs the given actions.mRunFastFailAsync
(Runnable... actions) Returns a new Cffu that is asynchronously completed by tasks running in the Cffu's default asynchronous execution facility after runs the given actions.mRunFastFailAsync
(Executor executor, Runnable... actions) Returns a new Cffu that is asynchronously completed by tasks running in the given Executor after runs the given actions.mSupplyAllSuccessAsync
(T valueIfFailed, Executor executor, Supplier<? extends T>... 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.mSupplyAllSuccessAsync
(T valueIfFailed, Supplier<? extends T>... 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.final <T> Cffu
<T> mSupplyAnyAsync
(Executor executor, Supplier<? extends T>... suppliers) Returns a new Cffu that is completed when any of tasks running in the given Executor by calling the given Suppliers complete, with the same result.final <T> Cffu
<T> mSupplyAnyAsync
(Supplier<? extends T>... suppliers) Returns a new Cffu that is completed when any of tasks running in the Cffu's default asynchronous execution facility by calling the given Suppliers complete, with the same result.final <T> Cffu
<T> mSupplyAnySuccessAsync
(Executor executor, Supplier<? extends T>... suppliers) Returns a new Cffu that is asynchronously successful when any of tasks running in the given executor by calling the given Suppliers success, with the same result.final <T> Cffu
<T> mSupplyAnySuccessAsync
(Supplier<? extends T>... suppliers) Returns a new Cffu that is asynchronously successful when any of tasks running in the Cffu's default asynchronous execution facility by calling the given Suppliers success, with the same result.mSupplyAsync
(Executor executor, Supplier<? extends T>... suppliers) Returns a new Cffu 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.mSupplyAsync
(Supplier<? extends T>... suppliers) Returns a new Cffu that is asynchronously completed by tasks running in the Cffu's default asynchronous execution facility with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.mSupplyFastFailAsync
(Executor executor, Supplier<? extends T>... suppliers) Returns a new Cffu 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.mSupplyFastFailAsync
(Supplier<? extends T>... suppliers) Returns a new Cffu that is asynchronously completed by tasks running in the Cffu's default asynchronous execution facility with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.mSupplyMostSuccessAsync
(T valueIfNotSuccess, long timeout, TimeUnit unit, Supplier<? extends T>... suppliers) 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(timeout
, aka as many results as possible in the given time) in the same order of the given Suppliers arguments.mSupplyMostSuccessAsync
(T valueIfNotSuccess, Executor executor, long timeout, TimeUnit unit, Supplier<? extends T>... 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(timeout
, aka as many results as possible in the given time) in the same order of the given Suppliers arguments.<T> Cffu
<T> Return an incomplete Cffu, equivalent toCompletableFuture()
constructor.Returns a new Cffu that is asynchronously completed by a task running in thedefaultExecutor()
after it runs the given action.Returns a new Cffu that is asynchronously completed by a task running in the given executor after it runs the given action.<T> Cffu
<T> supplyAsync
(Supplier<T> supplier) Returns a new Cffu that is asynchronously completed by a task running in thedefaultExecutor()
with the value obtained by calling the given Supplier.<T> Cffu
<T> supplyAsync
(Supplier<T> supplier, Executor executor) Returns a new Cffu that is asynchronously completed by a task running in the given executor with the value obtained by calling the given Supplier.<T> Cffu
<T> toCffu
(CompletionStage<T> stage) Returns a Cffu maintaining the same completion properties as this stage and thisCffuFactory
config.final <T> Cffu<T>[]
toCffuArray
(CompletionStage<T>... stages) A convenient util method for wrap inputCompletableFuture
/CompletionStage
/Cffu
array element bytoCffu(CompletionStage)
.tupleMSupplyAllSuccessAsync
(Executor executor, Supplier<? extends T1> supplier1, Supplier<? extends T2> 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.tupleMSupplyAllSuccessAsync
(Executor executor, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> 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.tupleMSupplyAllSuccessAsync
(Executor executor, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> 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.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 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.tupleMSupplyAllSuccessAsync
(Supplier<? extends T1> supplier1, Supplier<? extends T2> 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.tupleMSupplyAllSuccessAsync
(Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> 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.tupleMSupplyAllSuccessAsync
(Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> 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.tupleMSupplyAllSuccessAsync
(Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4, Supplier<? extends T5> supplier5) 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.tupleMSupplyAsync
(Executor executor, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2) Returns a new Cffu 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.tupleMSupplyAsync
(Executor executor, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3) Returns a new Cffu 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.tupleMSupplyAsync
(Executor executor, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4) Returns a new Cffu 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.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 Cffu 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.tupleMSupplyAsync
(Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2) Returns a new Cffu that is asynchronously completed by tasks running in thedefaultExecutor()
with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.tupleMSupplyAsync
(Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3) Returns a new Cffu that is asynchronously completed by tasks running in thedefaultExecutor()
with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.tupleMSupplyAsync
(Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4) Returns a new Cffu that is asynchronously completed by tasks running in thedefaultExecutor()
with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.tupleMSupplyAsync
(Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4, Supplier<? extends T5> supplier5) Returns a new Cffu that is asynchronously completed by tasks running in thedefaultExecutor()
with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.tupleMSupplyFastFailAsync
(Executor executor, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2) Returns a new Cffu that is asynchronously completed by tasks running in thedefaultExecutor()
with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.tupleMSupplyFastFailAsync
(Executor executor, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3) Returns a new Cffu 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.tupleMSupplyFastFailAsync
(Executor executor, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4) Returns a new Cffu 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.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 Cffu 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.tupleMSupplyFastFailAsync
(Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2) Returns a new Cffu that is asynchronously completed by tasks running in thedefaultExecutor()
with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.tupleMSupplyFastFailAsync
(Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3) Returns a new Cffu 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.tupleMSupplyFastFailAsync
(Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4) Returns a new Cffu that is asynchronously completed by tasks running in thedefaultExecutor()
with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.tupleMSupplyFastFailAsync
(Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4, Supplier<? extends T5> supplier5) Returns a new Cffu that is asynchronously completed by tasks running in thedefaultExecutor()
with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.tupleMSupplyMostSuccessAsync
(long timeout, TimeUnit unit, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2) 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(timeout
, aka as many results as possible in the given time) in the same order of the given Suppliers arguments.tupleMSupplyMostSuccessAsync
(long timeout, TimeUnit unit, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3) 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(timeout
, aka as many results as possible in the given time) in the same order of the given Suppliers arguments.tupleMSupplyMostSuccessAsync
(long timeout, TimeUnit unit, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4) 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(timeout
, aka as many results as possible in the given time) in the same order of the given Suppliers arguments.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 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(timeout
, aka as many results as possible in the given time) in the same order of the given Suppliers arguments.tupleMSupplyMostSuccessAsync
(Executor executor, long timeout, TimeUnit unit, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2) 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(timeout
, aka as many results as possible in the given time) in the same order of the given Suppliers arguments.tupleMSupplyMostSuccessAsync
(Executor executor, long timeout, TimeUnit unit, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3) 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(timeout
, aka as many results as possible in the given time) in the same order of the given Suppliers arguments.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 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(timeout
, aka as many results as possible in the given time) in the same order of the given Suppliers arguments.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 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(timeout
, aka as many results as possible in the given time) in the same order of the given Suppliers arguments.
-
Method Details
-
builder
Returns aCffuFactoryBuilder
withdefaultExecutor
setting.- See Also:
-
newIncompleteCffu
Return an incomplete Cffu, equivalent toCompletableFuture()
constructor.In general, should not use this method in biz code, prefer other factory methods of Cffu.
- See Also:
-
supplyAsync
@CheckReturnValue(explanation="should use the returned Cffu; otherwise, prefer method `runAsync`") public <T> Cffu<T> supplyAsync(Supplier<T> supplier) Returns a new Cffu that is asynchronously completed by a task running in thedefaultExecutor()
with the value obtained by calling the given Supplier.- Type Parameters:
T
- the function's return type- Parameters:
supplier
- a function returning the value to be used to complete the returned Cffu- Returns:
- the new Cffu
-
supplyAsync
@CheckReturnValue(explanation="should use the returned Cffu; otherwise, prefer method `runAsync`") public <T> Cffu<T> supplyAsync(Supplier<T> supplier, Executor executor) Returns a new Cffu that is asynchronously completed by a task running in the given executor with the value obtained by calling the given Supplier.- Type Parameters:
T
- the function's return type- Parameters:
supplier
- a function returning the value to be used to complete the returned Cffuexecutor
- the executor to use for asynchronous execution- Returns:
- the new Cffu
-
runAsync
Returns a new Cffu that is asynchronously completed by a task running in thedefaultExecutor()
after it runs the given action.- Parameters:
action
- the action to run before completing the returned Cffu- Returns:
- the new Cffu
-
runAsync
Returns a new Cffu that is asynchronously completed by a task running in the given executor after it runs the given action.- Parameters:
action
- the action to run before completing the returned Cffuexecutor
- the executor to use for asynchronous execution- Returns:
- the new Cffu
-
mSupplyFastFailAsync
@SafeVarargs public final <T> Cffu<List<T>> mSupplyFastFailAsync(Supplier<? extends T>... suppliers) Returns a new Cffu that is asynchronously completed by tasks running in the Cffu'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 Cffu- Returns:
- the new Cffu
- See Also:
-
mSupplyFastFailAsync
@SafeVarargs public final <T> Cffu<List<T>> mSupplyFastFailAsync(Executor executor, Supplier<? extends T>... suppliers) Returns a new Cffu 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 executionsuppliers
- the suppliers returning the value to be used to complete the returned Cffu- Returns:
- the new Cffu
- See Also:
-
mSupplyAllSuccessAsync
@SafeVarargs public final <T> Cffu<List<T>> mSupplyAllSuccessAsync(@Nullable T valueIfFailed, Supplier<? extends T>... 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.
- Type Parameters:
T
- the suppliers' return type- Parameters:
valueIfFailed
- the value to return if not failedsuppliers
- the suppliers returning the value to be used to complete the returned Cffu- Returns:
- the new Cffu
- See Also:
-
mSupplyAllSuccessAsync
@SafeVarargs public final <T> Cffu<List<T>> mSupplyAllSuccessAsync(@Nullable T valueIfFailed, Executor executor, Supplier<? extends T>... 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.
- Type Parameters:
T
- the suppliers' return type- Parameters:
valueIfFailed
- the value to return if not failedexecutor
- the executor to use for asynchronous executionsuppliers
- the suppliers returning the value to be used to complete the returned Cffu- Returns:
- the new Cffu
- See Also:
-
mSupplyMostSuccessAsync
@SafeVarargs public final <T> Cffu<List<T>> mSupplyMostSuccessAsync(@Nullable T valueIfNotSuccess, long timeout, TimeUnit unit, Supplier<? extends T>... suppliers) 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(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 successfullytimeout
- how long to wait in units ofunit
unit
- aTimeUnit
determining how to interpret thetimeout
parametersuppliers
- the suppliers returning the value to be used to complete the returned Cffu- Returns:
- the new Cffu
- See Also:
-
mSupplyMostSuccessAsync
@SafeVarargs public final <T> Cffu<List<T>> mSupplyMostSuccessAsync(@Nullable T valueIfNotSuccess, Executor executor, long timeout, TimeUnit unit, Supplier<? extends T>... 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(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 successfullyexecutor
- the executor to use for asynchronous executiontimeout
- how long to wait in units ofunit
unit
- aTimeUnit
determining how to interpret thetimeout
parametersuppliers
- the suppliers returning the value to be used to complete the returned Cffu- Returns:
- the new Cffu
- See Also:
-
mSupplyAsync
Returns a new Cffu that is asynchronously completed by tasks running in the Cffu'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 Cffu- Returns:
- the new Cffu
- See Also:
-
mSupplyAsync
@SafeVarargs public final <T> Cffu<List<T>> mSupplyAsync(Executor executor, Supplier<? extends T>... suppliers) Returns a new Cffu 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 executionsuppliers
- the suppliers returning the value to be used to complete the returned Cffu- Returns:
- the new Cffu
- See Also:
-
mSupplyAnySuccessAsync
Returns a new Cffu that is asynchronously successful when any of tasks running in the Cffu's default asynchronous execution facility by calling the given Suppliers success, with the same result. Otherwise, all the given tasks complete exceptionally, the returned Cffu 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 Cffu that is already completed exceptionally with a CompletionException holding aNoCfsProvidedException
as its cause.- Type Parameters:
T
- the suppliers' return type- Parameters:
suppliers
- the suppliers returning the value to be used to complete the returned Cffu- Returns:
- the new Cffu
- See Also:
-
mSupplyAnySuccessAsync
@SafeVarargs public final <T> Cffu<T> mSupplyAnySuccessAsync(Executor executor, Supplier<? extends T>... suppliers) Returns a new Cffu 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 Cffu 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 Cffu that is already completed exceptionally with a CompletionException holding aNoCfsProvidedException
as its cause.- Type Parameters:
T
- the suppliers' return type- Parameters:
executor
- the executor to use for asynchronous executionsuppliers
- the suppliers returning the value to be used to complete the returned Cffu- Returns:
- the new Cffu
- See Also:
-
mSupplyAnyAsync
Returns a new Cffu that is completed when any of tasks running in the Cffu's default asynchronous execution facility by calling the given Suppliers complete, with the same result. Otherwise, if it completed exceptionally, the returned Cffu also does so, with a CompletionException holding this exception as its cause. If no suppliers are provided, returns an incomplete Cffu.- Type Parameters:
T
- the suppliers' return type- Parameters:
suppliers
- the suppliers returning the value to be used to complete the returned Cffu- Returns:
- the new Cffu
- See Also:
-
mSupplyAnyAsync
@SafeVarargs public final <T> Cffu<T> mSupplyAnyAsync(Executor executor, Supplier<? extends T>... suppliers) Returns a new Cffu 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 Cffu also does so, with a CompletionException holding this exception as its cause. If no suppliers are provided, returns an incomplete Cffu.- Type Parameters:
T
- the suppliers' return type- Parameters:
executor
- the executor to use for asynchronous executionsuppliers
- the suppliers returning the value to be used to complete the returned Cffu- Returns:
- the new Cffu
- See Also:
-
mRunFastFailAsync
Returns a new Cffu that is asynchronously completed by tasks running in the Cffu's default asynchronous execution facility after runs the given actions.- Parameters:
actions
- the actions to run before completing the returned Cffu- Returns:
- the new Cffu
- See Also:
-
mRunFastFailAsync
Returns a new Cffu that is asynchronously completed by tasks running in the given Executor after runs the given actions.- Parameters:
executor
- the executor to use for asynchronous executionactions
- the actions to run before completing the returned Cffu- Returns:
- the new Cffu
- See Also:
-
mRunAsync
Returns a new Cffu that is asynchronously completed by tasks running in the Cffu's default asynchronous execution facility after runs the given actions.- Parameters:
actions
- the actions to run before completing the returned Cffu- Returns:
- the new Cffu
- See Also:
-
mRunAsync
Returns a new Cffu that is asynchronously completed by tasks running in the given Executor after runs the given actions.- Parameters:
executor
- the executor to use for asynchronous executionactions
- the actions to run before completing the returned Cffu- Returns:
- the new Cffu
- See Also:
-
mRunAnySuccessAsync
Returns a new Cffu that is asynchronously successful when any tasks running in the Cffu's default asynchronous execution facility success.- Parameters:
actions
- the actions to run before completing the returned Cffu- Returns:
- the new Cffu
- See Also:
-
mRunAnySuccessAsync
Returns a new Cffu that is asynchronously completed when any tasks running in the Cffu's default asynchronous execution facility.- Parameters:
executor
- the executor to use for asynchronous executionactions
- the actions to run before completing the returned Cffu- Returns:
- the new Cffu
- See Also:
-
mRunAnyAsync
Returns a new Cffu that is asynchronously completed when any tasks running in the Cffu's default asynchronous execution facility.- Parameters:
actions
- the actions to run before completing the returned Cffu- Returns:
- the new Cffu
- See Also:
-
mRunAnyAsync
Returns a new Cffu that is asynchronously completed when any tasks running in the given executor complete.- Parameters:
executor
- the executor to use for asynchronous executionactions
- the actions to run before completing the returned Cffu- Returns:
- the new Cffu
- See Also:
-
tupleMSupplyFastFailAsync
public <T1,T2> Cffu<Tuple2<T1,T2>> tupleMSupplyFastFailAsync(Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2) Returns a new Cffu that is asynchronously completed by tasks running in thedefaultExecutor()
with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.- Returns:
- the new Cffu
- See Also:
-
tupleMSupplyFastFailAsync
public <T1,T2> Cffu<Tuple2<T1,T2>> tupleMSupplyFastFailAsync(Executor executor, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2) Returns a new Cffu that is asynchronously completed by tasks running in thedefaultExecutor()
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 Cffu
- See Also:
-
tupleMSupplyFastFailAsync
public <T1,T2, Cffu<Tuple3<T1,T3> T2, tupleMSupplyFastFailAsyncT3>> (Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3) Returns a new Cffu 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.- Returns:
- the new Cffu
- See Also:
-
tupleMSupplyFastFailAsync
public <T1,T2, Cffu<Tuple3<T1,T3> T2, tupleMSupplyFastFailAsyncT3>> (Executor executor, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3) Returns a new Cffu 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 Cffu
- See Also:
-
tupleMSupplyFastFailAsync
public <T1,T2, Cffu<Tuple4<T1,T3, T4> T2, tupleMSupplyFastFailAsyncT3, T4>> (Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4) Returns a new Cffu that is asynchronously completed by tasks running in thedefaultExecutor()
with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.- Returns:
- the new Cffu
- See Also:
-
tupleMSupplyFastFailAsync
public <T1,T2, Cffu<Tuple4<T1,T3, T4> T2, tupleMSupplyFastFailAsyncT3, T4>> (Executor executor, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4) Returns a new Cffu 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 Cffu
- See Also:
-
tupleMSupplyFastFailAsync
public <T1,T2, Cffu<Tuple5<T1,T3, T4, T5> T2, tupleMSupplyFastFailAsyncT3, T4, T5>> (Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4, Supplier<? extends T5> supplier5) Returns a new Cffu that is asynchronously completed by tasks running in thedefaultExecutor()
with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.- Returns:
- the new Cffu
- See Also:
-
tupleMSupplyFastFailAsync
public <T1,T2, Cffu<Tuple5<T1,T3, T4, T5> T2, tupleMSupplyFastFailAsyncT3, T4, T5>> (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 Cffu 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 Cffu
- See Also:
-
tupleMSupplyAllSuccessAsync
public <T1,T2> Cffu<Tuple2<T1,T2>> tupleMSupplyAllSuccessAsync(Supplier<? extends T1> supplier1, Supplier<? extends T2> 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
null
.- Returns:
- the new Cffu
-
tupleMSupplyAllSuccessAsync
public <T1,T2> Cffu<Tuple2<T1,T2>> tupleMSupplyAllSuccessAsync(Executor executor, Supplier<? extends T1> supplier1, Supplier<? extends T2> 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
null
.- Parameters:
executor
- the executor to use for asynchronous execution- Returns:
- the new Cffu
-
tupleMSupplyAllSuccessAsync
public <T1,T2, Cffu<Tuple3<T1,T3> T2, tupleMSupplyAllSuccessAsyncT3>> (Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> 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
null
.- Returns:
- the new Cffu
-
tupleMSupplyAllSuccessAsync
public <T1,T2, Cffu<Tuple3<T1,T3> T2, tupleMSupplyAllSuccessAsyncT3>> (Executor executor, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> 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
null
.- Parameters:
executor
- the executor to use for asynchronous execution- Returns:
- the new Cffu
-
tupleMSupplyAllSuccessAsync
public <T1,T2, Cffu<Tuple4<T1,T3, T4> T2, tupleMSupplyAllSuccessAsyncT3, T4>> (Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> 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
null
.- Returns:
- the new Cffu
-
tupleMSupplyAllSuccessAsync
public <T1,T2, Cffu<Tuple4<T1,T3, T4> T2, tupleMSupplyAllSuccessAsyncT3, T4>> (Executor executor, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> 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
null
.- Parameters:
executor
- the executor to use for asynchronous execution- Returns:
- the new Cffu
-
tupleMSupplyAllSuccessAsync
public <T1,T2, Cffu<Tuple5<T1,T3, T4, T5> T2, tupleMSupplyAllSuccessAsyncT3, T4, T5>> (Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4, Supplier<? extends T5> supplier5) 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
null
.- Returns:
- the new Cffu
-
tupleMSupplyAllSuccessAsync
public <T1,T2, Cffu<Tuple5<T1,T3, T4, T5> T2, tupleMSupplyAllSuccessAsyncT3, T4, T5>> (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 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
null
.- Parameters:
executor
- the executor to use for asynchronous execution- Returns:
- the new Cffu
-
tupleMSupplyMostSuccessAsync
public <T1,T2> Cffu<Tuple2<T1,T2>> tupleMSupplyMostSuccessAsync(long timeout, TimeUnit unit, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2) 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(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 ofunit
unit
- aTimeUnit
determining how to interpret thetimeout
parameter- Returns:
- the new Cffu
-
tupleMSupplyMostSuccessAsync
public <T1,T2> Cffu<Tuple2<T1,T2>> tupleMSupplyMostSuccessAsync(Executor executor, long timeout, TimeUnit unit, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2) 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(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 executiontimeout
- how long to wait in units ofunit
unit
- aTimeUnit
determining how to interpret thetimeout
parameter- Returns:
- the new Cffu
-
tupleMSupplyMostSuccessAsync
public <T1,T2, Cffu<Tuple3<T1,T3> T2, tupleMSupplyMostSuccessAsyncT3>> (long timeout, TimeUnit unit, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3) 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(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 ofunit
unit
- aTimeUnit
determining how to interpret thetimeout
parameter- Returns:
- the new Cffu
-
tupleMSupplyMostSuccessAsync
public <T1,T2, Cffu<Tuple3<T1,T3> T2, tupleMSupplyMostSuccessAsyncT3>> (Executor executor, long timeout, TimeUnit unit, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3) 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(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 executiontimeout
- how long to wait in units ofunit
unit
- aTimeUnit
determining how to interpret thetimeout
parameter- Returns:
- the new Cffu
-
tupleMSupplyMostSuccessAsync
public <T1,T2, Cffu<Tuple4<T1,T3, T4> T2, tupleMSupplyMostSuccessAsyncT3, T4>> (long timeout, TimeUnit unit, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4) 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(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 ofunit
unit
- aTimeUnit
determining how to interpret thetimeout
parameter- Returns:
- the new Cffu
-
tupleMSupplyMostSuccessAsync
public <T1,T2, Cffu<Tuple4<T1,T3, T4> T2, tupleMSupplyMostSuccessAsyncT3, T4>> (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 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(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 executiontimeout
- how long to wait in units ofunit
unit
- aTimeUnit
determining how to interpret thetimeout
parameter- Returns:
- the new Cffu
-
tupleMSupplyMostSuccessAsync
public <T1,T2, Cffu<Tuple5<T1,T3, T4, T5> T2, tupleMSupplyMostSuccessAsyncT3, T4, T5>> (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 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(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 ofunit
unit
- aTimeUnit
determining how to interpret thetimeout
parameter- Returns:
- the new Cffu
-
tupleMSupplyMostSuccessAsync
public <T1,T2, Cffu<Tuple5<T1,T3, T4, T5> T2, tupleMSupplyMostSuccessAsyncT3, T4, T5>> (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 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(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 executiontimeout
- how long to wait in units ofunit
unit
- aTimeUnit
determining how to interpret thetimeout
parameter- Returns:
- the new Cffu
-
tupleMSupplyAsync
public <T1,T2> Cffu<Tuple2<T1,T2>> tupleMSupplyAsync(Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2) Returns a new Cffu that is asynchronously completed by tasks running in thedefaultExecutor()
with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.- Returns:
- the new Cffu
- See Also:
-
tupleMSupplyAsync
public <T1,T2> Cffu<Tuple2<T1,T2>> tupleMSupplyAsync(Executor executor, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2) Returns a new Cffu 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 Cffu
- See Also:
-
tupleMSupplyAsync
public <T1,T2, Cffu<Tuple3<T1,T3> T2, tupleMSupplyAsyncT3>> (Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3) Returns a new Cffu that is asynchronously completed by tasks running in thedefaultExecutor()
with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.- Returns:
- the new Cffu
- See Also:
-
tupleMSupplyAsync
public <T1,T2, Cffu<Tuple3<T1,T3> T2, tupleMSupplyAsyncT3>> (Executor executor, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3) Returns a new Cffu 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 Cffu
- See Also:
-
tupleMSupplyAsync
public <T1,T2, Cffu<Tuple4<T1,T3, T4> T2, tupleMSupplyAsyncT3, T4>> (Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4) Returns a new Cffu that is asynchronously completed by tasks running in thedefaultExecutor()
with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.- Returns:
- the new Cffu
- See Also:
-
tupleMSupplyAsync
public <T1,T2, Cffu<Tuple4<T1,T3, T4> T2, tupleMSupplyAsyncT3, T4>> (Executor executor, Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4) Returns a new Cffu 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 Cffu
- See Also:
-
tupleMSupplyAsync
public <T1,T2, Cffu<Tuple5<T1,T3, T4, T5> T2, tupleMSupplyAsyncT3, T4, T5>> (Supplier<? extends T1> supplier1, Supplier<? extends T2> supplier2, Supplier<? extends T3> supplier3, Supplier<? extends T4> supplier4, Supplier<? extends T5> supplier5) Returns a new Cffu that is asynchronously completed by tasks running in thedefaultExecutor()
with the values obtained by calling the given Suppliers in the same order of the given Suppliers arguments.- Returns:
- the new Cffu
- See Also:
-
tupleMSupplyAsync
public <T1,T2, Cffu<Tuple5<T1,T3, T4, T5> T2, tupleMSupplyAsyncT3, T4, T5>> (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 Cffu 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 Cffu
- See Also:
-
allResultsFastFailOf
@Contract(pure=true) @SafeVarargs public final <T> Cffu<List<T>> allResultsFastFailOf(CompletionStage<? extends T>... 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 success; If any of the given stages complete exceptionally, then the returned Cffu 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 Cffu 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 Cffu that is successful when all the given stages success
- Throws:
NullPointerException
- if the array or any of its elements arenull
-
allSuccessResultsOf
@Contract(pure=true) @SafeVarargs public final <T> Cffu<List<T>> allSuccessResultsOf(@Nullable T valueIfFailed, CompletionStage<? extends T>... 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.- Parameters:
valueIfFailed
- the value to return if not completed successfullycfs
- the stages- Throws:
NullPointerException
- if the array or any of its elements arenull
-
mostSuccessResultsOf
@Contract(pure=true) @SafeVarargs public final <T> Cffu<List<T>> mostSuccessResultsOf(@Nullable T valueIfNotSuccess, long timeout, TimeUnit unit, CompletionStage<? extends T>... cfs) Returns a new Cffu 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 successfullytimeout
- how long to wait in units ofunit
unit
- aTimeUnit
determining how to interpret thetimeout
parametercfs
- the stages- See Also:
-
allResultsOf
@Contract(pure=true) @SafeVarargs public final <T> Cffu<List<T>> allResultsOf(CompletionStage<? extends T>... cfs) Returns a new Cffu with the results in the same order of the given stages arguments, the new Cffu is completed when all the given stages complete; If any of the given stages complete exceptionally, then the returned Cffu also does so, with a CompletionException holding this exception as its cause. If no stages are provided, returns a Cffu completed with the value empty list.This method is the same as
allOf(CompletionStage[])
, except that the returned Cffu contains the results of the given stages.- Parameters:
cfs
- the stages- Returns:
- a new Cffu that is completed when all the given stages complete
- Throws:
NullPointerException
- if the array or any of its elements arenull
-
allFastFailOf
Returns a new Cffu that is successful when all the given stages success; If any of the given stages complete exceptionally, then the returned Cffu also does so *without* waiting other incomplete given stages, with a CompletionException holding this exception as its cause. Otherwise, the results of the given stages are not reflected in the returned Cffu(Cffu<Void>
), but may be obtained by inspecting them individually. If no stages are provided, returns a Cffu completed with the valuenull
.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:
allResultsFastFailOf(CompletionStage[])
allTupleFastFailOf(CompletionStage, CompletionStage)
/allTupleFastFailOf(CompletionStage, CompletionStage, CompletionStage, CompletionStage, CompletionStage)
(provided overloaded methods with 2~5 input)
If you need the successful results of given stages in the given time, prefer below methods:
- Parameters:
cfs
- the stages- Returns:
- a new Cffu that is successful when all the given stages success
- Throws:
NullPointerException
- if the array or any of its elements arenull
-
allOf
Returns a new Cffu that is completed when all the given stages complete; If any of the given stages complete exceptionally, then the returned Cffu 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 Cffu(Cffu<Void>
), but may be obtained by inspecting them individually. If no stages are provided, returns a Cffu completed with the valuenull
.This method is the same as
CompletableFuture.allOf(CompletableFuture[])
, except that the parameter type is more genericCompletionStage
instead ofCompletableFuture
.If you need the results of given stages, prefer below methods:
allResultsOf(CompletionStage[])
allTupleOf(CompletionStage, CompletionStage)
/allTupleOf(CompletionStage, CompletionStage, CompletionStage, CompletionStage, CompletionStage)
If you need the successful results of given stages in the given time, prefer below methods:
- Parameters:
cfs
- the stages- Returns:
- a new Cffu that is completed when all the given stages complete
- Throws:
NullPointerException
- if the array or any of its elements arenull
-
anySuccessOf
Returns a new Cffu that is successful when any of the given stages success, with the same result. Otherwise, all the given stages complete exceptionally, the returned Cffu 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 Cffu that is already completed exceptionally with a CompletionException holding aNoCfsProvidedException
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 Cffu that is successful when any of the given stages success, with the same result
- Throws:
NullPointerException
- if the array or any of its elements arenull
-
anyOf
@Contract(pure=true) @SafeVarargs public final <T> Cffu<T> anyOf(CompletionStage<? extends T>... cfs) Returns a new Cffu that is completed when any of the given stages complete, with the same result.
Otherwise, if it completed exceptionally, the returned Cffu also does so, with a CompletionException holding this exception as its cause.
If no stages are provided, returns an incomplete Cffu.This method is the same as
CompletableFuture.anyOf(CompletableFuture[])
, except that the parameter type is more genericCompletionStage
instead ofCompletableFuture
, and the return type is more specificT
instead ofObject
.- Parameters:
cfs
- the stages- Returns:
- a new Cffu 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 arenull
-
allTupleFastFailOf
@Contract(pure=true) public <T1,T2> Cffu<Tuple2<T1,T2>> allTupleFastFailOf(CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2) Returns a new Cffu that is successful when the given two stages success. If any of the given stages complete exceptionally, then the returned Cffu also does so *without* waiting other incomplete given stages, with a CompletionException holding this exception as its cause.- Returns:
- a new Cffu that is successful when the given two stages success
- Throws:
NullPointerException
- if any of the given stages arenull
- See Also:
-
allTupleFastFailOf
@Contract(pure=true) public <T1,T2, Cffu<Tuple3<T1,T3> T2, allTupleFastFailOfT3>> (CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3) Returns a new Cffu that is successful when the given three stages success. If any of the given stages complete exceptionally, then the returned Cffu also does so *without* waiting other incomplete given stages, with a CompletionException holding this exception as its cause.- Returns:
- a new Cffu that is successful when the given three stages success
- Throws:
NullPointerException
- if any of the given stages arenull
- See Also:
-
allTupleFastFailOf
@Contract(pure=true) public <T1,T2, Cffu<Tuple4<T1,T3, T4> T2, allTupleFastFailOfT3, T4>> (CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3, CompletionStage<? extends T4> cf4) Returns a new Cffu that is successful when the given four stages success. If any of the given stages complete exceptionally, then the returned Cffu also does so *without* waiting other incomplete given stages, with a CompletionException holding this exception as its cause.- Returns:
- a new Cffu that is successful when the given four stages success
- Throws:
NullPointerException
- if any of the given stages arenull
- See Also:
-
allTupleFastFailOf
@Contract(pure=true) public <T1,T2, Cffu<Tuple5<T1,T3, T4, T5> T2, allTupleFastFailOfT3, T4, T5>> (CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3, CompletionStage<? extends T4> cf4, CompletionStage<? extends T5> cf5) Returns a new Cffu that is successful when the given five stages success. If any of the given stages complete exceptionally, then the returned Cffu also does so *without* waiting other incomplete given stages, with a CompletionException holding this exception as its cause.- Returns:
- a new Cffu that is successful when the given five stages success
- Throws:
NullPointerException
- if any of the given stages arenull
- See Also:
-
allSuccessTupleOf
@Contract(pure=true) public <T1,T2> Cffu<Tuple2<T1,T2>> allSuccessTupleOf(CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> 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.- Returns:
- a new Cffu
- Throws:
NullPointerException
- if any of the given stages arenull
- See Also:
-
allSuccessTupleOf
@Contract(pure=true) public <T1,T2, Cffu<Tuple3<T1,T3> T2, allSuccessTupleOfT3>> (CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> 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.- Returns:
- a new Cffu
- Throws:
NullPointerException
- if any of the given stages arenull
- See Also:
-
allSuccessTupleOf
@Contract(pure=true) public <T1,T2, Cffu<Tuple4<T1,T3, T4> T2, allSuccessTupleOfT3, T4>> (CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3, CompletionStage<? extends T4> 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.- Returns:
- a new Cffu
- Throws:
NullPointerException
- if any of the given stages arenull
- See Also:
-
allSuccessTupleOf
@Contract(pure=true) public <T1,T2, Cffu<Tuple5<T1,T3, T4, T5> T2, allSuccessTupleOfT3, T4, T5>> (CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3, CompletionStage<? extends T4> cf4, CompletionStage<? extends T5> 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.- Returns:
- a new Cffu
- Throws:
NullPointerException
- if any of the given stages arenull
- See Also:
-
mostSuccessTupleOf
@Contract(pure=true) public <T1,T2> Cffu<Tuple2<T1,T2>> mostSuccessTupleOf(long timeout, TimeUnit unit, CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2) Returns a new Cffu with the most results in the same order of the given two 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 ofunit
unit
- aTimeUnit
determining how to interpret thetimeout
parameter- Returns:
- a new Cffu that is completed when the given two stages complete
- See Also:
-
mostSuccessTupleOf
@Contract(pure=true) public <T1,T2, Cffu<Tuple3<T1,T3> T2, mostSuccessTupleOfT3>> (long timeout, TimeUnit unit, CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3) Returns a new Cffu with the most results in the same order of the given three 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 ofunit
unit
- aTimeUnit
determining how to interpret thetimeout
parameter- Returns:
- a new Cffu that is completed when the given three stages complete
- See Also:
-
mostSuccessTupleOf
@Contract(pure=true) public <T1,T2, Cffu<Tuple4<T1,T3, T4> T2, mostSuccessTupleOfT3, T4>> (long timeout, TimeUnit unit, CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3, CompletionStage<? extends T4> cf4) Returns a new Cffu with the most results in the same order of the given four 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 ofunit
unit
- aTimeUnit
determining how to interpret thetimeout
parameter- Returns:
- a new Cffu that is completed when the given four stages complete
- See Also:
-
mostSuccessTupleOf
@Contract(pure=true) public <T1,T2, Cffu<Tuple5<T1,T3, T4, T5> T2, mostSuccessTupleOfT3, T4, T5>> (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 Cffu with the most results in the same order of the given five 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 ofunit
unit
- aTimeUnit
determining how to interpret thetimeout
parameter- Returns:
- a new Cffu that is completed when the given five stages complete
- See Also:
-
allTupleOf
@Contract(pure=true) public <T1,T2> Cffu<Tuple2<T1,T2>> allTupleOf(CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2) Returns a new Cffu that is completed when the given two stages complete. If any of the given stages complete exceptionally, then the returned Cffu also does so, with a CompletionException holding this exception as its cause.- Returns:
- a new Cffu that is completed when the given two stages complete
- Throws:
NullPointerException
- if any of the given stages arenull
- See Also:
-
allTupleOf
@Contract(pure=true) public <T1,T2, Cffu<Tuple3<T1,T3> T2, allTupleOfT3>> (CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3) Returns a new Cffu that is completed when the given three stages complete. If any of the given stages complete exceptionally, then the returned Cffu also does so, with a CompletionException holding this exception as its cause.- Returns:
- a new Cffu that is completed when the given three stages complete
- Throws:
NullPointerException
- if any of the given stages arenull
- See Also:
-
allTupleOf
@Contract(pure=true) public <T1,T2, Cffu<Tuple4<T1,T3, T4> T2, allTupleOfT3, T4>> (CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3, CompletionStage<? extends T4> cf4) Returns a new Cffu that is completed when the given four stages complete. If any of the given stages complete exceptionally, then the returned Cffu also does so, with a CompletionException holding this exception as its cause.- Returns:
- a new Cffu that is completed when the given four stages complete
- Throws:
NullPointerException
- if any of the given stages arenull
- See Also:
-
allTupleOf
@Contract(pure=true) public <T1,T2, Cffu<Tuple5<T1,T3, T4, T5> T2, allTupleOfT3, T4, T5>> (CompletionStage<? extends T1> cf1, CompletionStage<? extends T2> cf2, CompletionStage<? extends T3> cf3, CompletionStage<? extends T4> cf4, CompletionStage<? extends T5> cf5) Returns a new Cffu that is completed when the given five stages complete. If any of the given stages complete exceptionally, then the returned Cffu also does so, with a CompletionException holding this exception as its cause.- Returns:
- a new Cffu that is completed when the given five stages complete
- Throws:
NullPointerException
- if any of the given stages arenull
- See Also:
-
completedFuture
Returns a new Cffu that is already completed with the given value.- Type Parameters:
T
- the type of the value- Parameters:
value
- the value- Returns:
- the completed Cffu
-
completedStage
Returns a new CompletionStage that is already completed with the given value and supports only those methods in interfaceCompletionStage
.CAUTION:
if run on old Java 8, just return a Cffu with a *normal* underlying CompletableFuture which is NOT with a *minimal* CompletionStage.- Type Parameters:
T
- the type of the value- Parameters:
value
- the value- Returns:
- the completed CompletionStage
-
failedFuture
Returns a new Cffu 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 Cffu
-
failedStage
Returns a new CompletionStage that is already completed exceptionally with the given exception and supports only those methods in interfaceCompletionStage
.CAUTION:
if run on old Java 8, just return a Cffu with a *normal* underlying 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
-
toCffu
Returns a Cffu maintaining the same completion properties as this stage and thisCffuFactory
config. If this stage is already a Cffu and have the sameCffuFactory
, this method may return this stage itself.- Throws:
NullPointerException
- if the given stage is null- See Also:
-
toCffuArray
@Contract(pure=true) @SafeVarargs public final <T> Cffu<T>[] toCffuArray(CompletionStage<T>... stages) A convenient util method for wrap inputCompletableFuture
/CompletionStage
/Cffu
array element bytoCffu(CompletionStage)
.- Throws:
NullPointerException
- if the array or any of its elements arenull
- See Also:
-
delayedExecutor
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'sexecute
method.- Parameters:
delay
- how long to delay, in units ofunit
unit
- aTimeUnit
determining how to interpret thedelay
parameter- Returns:
- the new delayed executor
-
delayedExecutor
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'sexecute
method.- Parameters:
delay
- how long to delay, in units ofunit
unit
- aTimeUnit
determining how to interpret thedelay
parameterexecutor
- the base executor- Returns:
- the new delayed executor
-
cffuArrayUnwrap
@Contract(pure=true) @SafeVarargs public static <T> CompletableFuture<T>[] cffuArrayUnwrap(Cffu<T>... cfs) A convenient util method for unwrap inputCffu
array elements byCffu.cffuUnwrap()
.- Parameters:
cfs
- the Cffus- See Also:
-
cffuListToArray
Convert Cffu list to Cffu array.- See Also:
-
defaultExecutor
Returns the default Executor used for async methods that do not specify an Executor. Configured bybuilder(Executor)
.- Returns:
- the default executor
- See Also:
-
forbidObtrudeMethods
ReturnsforbidObtrudeMethods
or not.- See Also:
-