Skip to content

Commit

Permalink
WIP adjust executor parameter position
Browse files Browse the repository at this point in the history
  • Loading branch information
oldratlee committed Nov 30, 2024
1 parent 860c6f7 commit 3269037
Show file tree
Hide file tree
Showing 8 changed files with 115 additions and 120 deletions.
20 changes: 10 additions & 10 deletions cffu-core/src/main/java/io/foldright/cffu/Cffu.java
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ public final <U> Cffu<List<U>> thenMApplyAllSuccessAsync(
@SafeVarargs
public final <U> Cffu<List<U>> thenMApplyAllSuccessAsync(
@Nullable U valueIfFailed, Executor executor, Function<? super T, ? extends U>... fns) {
return resetCf(CompletableFutureUtils.thenMApplyAllSuccessAsync(cf, valueIfFailed, executor, fns));
return resetCf(CompletableFutureUtils.thenMApplyAllSuccessAsync(cf, executor, valueIfFailed, fns));
}

/**
Expand All @@ -278,7 +278,7 @@ public final <U> Cffu<List<U>> thenMApplyAllSuccessAsync(
@SafeVarargs
public final <U> Cffu<List<U>> thenMApplyMostSuccessAsync(
@Nullable U valueIfNotSuccess, long timeout, TimeUnit unit, Function<? super T, ? extends U>... fns) {
return thenMApplyMostSuccessAsync(valueIfNotSuccess, fac.defaultExecutor(), timeout, unit, fns);
return thenMApplyMostSuccessAsync(fac.defaultExecutor(), valueIfNotSuccess, timeout, unit, fns);
}

/**
Expand All @@ -290,9 +290,9 @@ public final <U> Cffu<List<U>> thenMApplyMostSuccessAsync(
*/
@SafeVarargs
public final <U> Cffu<List<U>> thenMApplyMostSuccessAsync(
@Nullable U valueIfNotSuccess, Executor executor, long timeout, TimeUnit unit,
Executor executor, @Nullable U valueIfNotSuccess, long timeout, TimeUnit unit,
Function<? super T, ? extends U>... fns) {
return resetCf(CompletableFutureUtils.thenMApplyMostSuccessAsync(cf, valueIfNotSuccess, executor, timeout, unit, fns));
return resetCf(CompletableFutureUtils.thenMApplyMostSuccessAsync(cf, executor, valueIfNotSuccess, timeout, unit, fns));
}

/**
Expand Down Expand Up @@ -770,7 +770,7 @@ public <U1, U2> Cffu<Tuple2<U1, U2>> thenMApplyMostSuccessTupleAsync(
}

/**
* Tuple variance of {@link #thenMApplyMostSuccessAsync(Object, Executor, long, TimeUnit, Function[])}
* Tuple variance of {@link #thenMApplyMostSuccessAsync(Executor, Object, long, TimeUnit, Function[])}
* with {@code null} valueIfNotSuccess.
* <p>
* If any of the provided suppliers is not completed normally, its corresponding position will contain {@code null}
Expand All @@ -796,7 +796,7 @@ public <U1, U2, U3> Cffu<Tuple3<U1, U2, U3>> thenMApplyMostSuccessTupleAsync(
}

/**
* Tuple variance of {@link #thenMApplyMostSuccessAsync(Object, Executor, long, TimeUnit, Function[])}
* Tuple variance of {@link #thenMApplyMostSuccessAsync(Executor, Object, long, TimeUnit, Function[])}
* with {@code null} valueIfNotSuccess.
* <p>
* If any of the provided suppliers is not completed normally, its corresponding position will contain {@code null}
Expand All @@ -823,7 +823,7 @@ public <U1, U2, U3, U4> Cffu<Tuple4<U1, U2, U3, U4>> thenMApplyMostSuccessTupleA
}

/**
* Tuple variance of {@link #thenMApplyMostSuccessAsync(Object, Executor, long, TimeUnit, Function[])}
* Tuple variance of {@link #thenMApplyMostSuccessAsync(Executor, Object, long, TimeUnit, Function[])}
* with {@code null} valueIfNotSuccess.
* <p>
* If any of the provided suppliers is not completed normally, its corresponding position will contain {@code null}
Expand Down Expand Up @@ -851,7 +851,7 @@ public <U1, U2, U3, U4, U5> Cffu<Tuple5<U1, U2, U3, U4, U5>> thenMApplyMostSucce
}

/**
* Tuple variance of {@link #thenMApplyMostSuccessAsync(Object, Executor, long, TimeUnit, Function[])}
* Tuple variance of {@link #thenMApplyMostSuccessAsync(Executor, Object, long, TimeUnit, Function[])}
* with {@code null} valueIfNotSuccess.
* <p>
* If any of the provided suppliers is not completed normally, its corresponding position will contain {@code null}
Expand Down Expand Up @@ -1666,7 +1666,7 @@ public Cffu<T> orTimeout(long timeout, TimeUnit unit) {
*/
public Cffu<T> orTimeout(Executor executorWhenTimeout, long timeout, TimeUnit unit) {
checkMinimalStage();
return resetCf(CompletableFutureUtils.cffuOrTimeout(cf, executorWhenTimeout, timeout, unit));
return resetCf(CompletableFutureUtils.cffuOrTimeout(cf, timeout, unit, executorWhenTimeout));
}

/**
Expand Down Expand Up @@ -1747,7 +1747,7 @@ public Cffu<T> completeOnTimeout(@Nullable T value, long timeout, TimeUnit unit)
*/
public Cffu<T> completeOnTimeout(@Nullable T value, Executor executorWhenTimeout, long timeout, TimeUnit unit) {
checkMinimalStage();
return resetCf(CompletableFutureUtils.cffuCompleteOnTimeout(cf, value, executorWhenTimeout, timeout, unit));
return resetCf(CompletableFutureUtils.cffuCompleteOnTimeout(cf, value, timeout, unit, executorWhenTimeout));
}

/**
Expand Down
6 changes: 3 additions & 3 deletions cffu-core/src/main/java/io/foldright/cffu/CffuFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ public final <T> Cffu<List<T>> mSupplyAllSuccessAsync(
@SafeVarargs
public final <T> Cffu<List<T>> mSupplyAllSuccessAsync(
@Nullable T valueIfFailed, Executor executor, Supplier<? extends T>... suppliers) {
return create(CompletableFutureUtils.mSupplyAllSuccessAsync(valueIfFailed, executor, suppliers));
return create(CompletableFutureUtils.mSupplyAllSuccessAsync(executor, valueIfFailed, suppliers));
}

/**
Expand All @@ -234,7 +234,7 @@ public final <T> Cffu<List<T>> mSupplyMostSuccessAsync(
public final <T> Cffu<List<T>> mSupplyMostSuccessAsync(
@Nullable T valueIfNotSuccess, Executor executor, long timeout, TimeUnit unit,
Supplier<? extends T>... suppliers) {
return create(CompletableFutureUtils.mSupplyMostSuccessAsync(valueIfNotSuccess, executor, timeout, unit, suppliers));
return create(CompletableFutureUtils.mSupplyMostSuccessAsync(executor, valueIfNotSuccess, timeout, unit, suppliers));
}

/**
Expand Down Expand Up @@ -793,7 +793,7 @@ public final <T> Cffu<List<T>> allSuccessResultsOf(
public final <T> Cffu<List<T>> mostSuccessResultsOf(
@Nullable T valueIfNotSuccess, long timeout, TimeUnit unit, CompletionStage<? extends T>... cfs) {
return create(CompletableFutureUtils.mostSuccessResultsOf(
valueIfNotSuccess, defaultExecutor, timeout, unit, cfs));
defaultExecutor, valueIfNotSuccess, timeout, unit, cfs));
}

/**
Expand Down
Loading

0 comments on commit 3269037

Please sign in to comment.