Skip to content

Commit

Permalink
thenTupleMApplyMostSuccessAsync
Browse files Browse the repository at this point in the history
  • Loading branch information
huhaosumail committed Jun 25, 2024
1 parent 22a19ab commit 6993c42
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2151,10 +2151,10 @@ public static <T, U1, U2, U3, U4, U5> CompletableFuture<Tuple5<U1, U2, U3, U4, U
* @param <U2> the function return type
* @return the new CompletableFuture
*/
public static <T, U1, U2> CompletableFuture<Tuple2<U1, U2>> tupleMApplyMostSuccessAsync(
public static <T, U1, U2> CompletableFuture<Tuple2<U1, U2>> thenTupleMApplyMostSuccessAsync(
CompletionStage<? extends T> cf,
long timeout, TimeUnit unit, Function<? super T, ? extends U1> fn1, Function<? super T, ? extends U2> fn2) {
return tupleMApplyMostSuccessAsync(cf, AsyncPoolHolder.ASYNC_POOL, timeout, unit, fn1, fn2);
return thenTupleMApplyMostSuccessAsync(cf, AsyncPoolHolder.ASYNC_POOL, timeout, unit, fn1, fn2);
}

/**
Expand All @@ -2176,7 +2176,7 @@ public static <T, U1, U2> CompletableFuture<Tuple2<U1, U2>> tupleMApplyMostSucce
* @param <U2> the function return type
* @return the new CompletableFuture
*/
public static <T, U1, U2> CompletableFuture<Tuple2<U1, U2>> tupleMApplyMostSuccessAsync(
public static <T, U1, U2> CompletableFuture<Tuple2<U1, U2>> thenTupleMApplyMostSuccessAsync(
CompletionStage<? extends T> cf, Executor executor, long timeout, TimeUnit unit, Function<? super T, ? extends U1> fn1, Function<? super T, ? extends U2> fn2) {
requireNonNull(executor, "executor is null");
requireNonNull(unit, "unit is null");
Expand Down Expand Up @@ -2207,10 +2207,10 @@ public static <T, U1, U2> CompletableFuture<Tuple2<U1, U2>> tupleMApplyMostSucce
* @param <U3> the function return type
* @return the new CompletableFuture
*/
public static <T, U1, U2, U3> CompletableFuture<Tuple3<U1, U2, U3>> tupleMApplyMostSuccessAsync(
public static <T, U1, U2, U3> CompletableFuture<Tuple3<U1, U2, U3>> thenTupleMApplyMostSuccessAsync(
CompletionStage<? extends T> cf,
long timeout, TimeUnit unit, Function<? super T, ? extends U1> fn1, Function<? super T, ? extends U2> fn2, Function<? super T, ? extends U3> fn3) {
return tupleMApplyMostSuccessAsync(cf, AsyncPoolHolder.ASYNC_POOL, timeout, unit, fn1, fn2, fn3);
return thenTupleMApplyMostSuccessAsync(cf, AsyncPoolHolder.ASYNC_POOL, timeout, unit, fn1, fn2, fn3);
}

/**
Expand All @@ -2234,7 +2234,7 @@ public static <T, U1, U2, U3> CompletableFuture<Tuple3<U1, U2, U3>> tupleMApplyM
* @param <U3> the function return type
* @return the new CompletableFuture
*/
public static <T, U1, U2, U3> CompletableFuture<Tuple3<U1, U2, U3>> tupleMApplyMostSuccessAsync(
public static <T, U1, U2, U3> CompletableFuture<Tuple3<U1, U2, U3>> thenTupleMApplyMostSuccessAsync(
CompletionStage<? extends T> cf, Executor executor, long timeout, TimeUnit unit, Function<? super T, ? extends U1> fn1, Function<? super T, ? extends U2> fn2, Function<? super T, ? extends U3> fn3) {
requireNonNull(executor, "executor is null");
requireNonNull(unit, "unit is null");
Expand Down Expand Up @@ -2267,10 +2267,10 @@ public static <T, U1, U2, U3> CompletableFuture<Tuple3<U1, U2, U3>> tupleMApplyM
* @param <U4> the function return type
* @return the new CompletableFuture
*/
public static <T, U1, U2, U3, U4> CompletableFuture<Tuple4<U1, U2, U3, U4>> tupleMApplyMostSuccessAsync(
public static <T, U1, U2, U3, U4> CompletableFuture<Tuple4<U1, U2, U3, U4>> thenTupleMApplyMostSuccessAsync(
CompletionStage<? extends T> cf, long timeout, TimeUnit unit, Function<? super T, ? extends U1> fn1,
Function<? super T, ? extends U2> fn2, Function<? super T, ? extends U3> fn3, Function<? super T, ? extends U4> fn4) {
return tupleMApplyMostSuccessAsync(cf, AsyncPoolHolder.ASYNC_POOL, timeout, unit, fn1, fn2, fn3, fn4);
return thenTupleMApplyMostSuccessAsync(cf, AsyncPoolHolder.ASYNC_POOL, timeout, unit, fn1, fn2, fn3, fn4);
}

/**
Expand All @@ -2296,7 +2296,7 @@ public static <T, U1, U2, U3, U4> CompletableFuture<Tuple4<U1, U2, U3, U4>> tupl
* @param <U4> the function return type
* @return the new CompletableFuture
*/
public static <T, U1, U2, U3, U4> CompletableFuture<Tuple4<U1, U2, U3, U4>> tupleMApplyMostSuccessAsync(
public static <T, U1, U2, U3, U4> CompletableFuture<Tuple4<U1, U2, U3, U4>> thenTupleMApplyMostSuccessAsync(
CompletionStage<? extends T> cf, Executor executor, long timeout, TimeUnit unit, Function<? super T, ? extends U1> fn1,
Function<? super T, ? extends U2> fn2, Function<? super T, ? extends U3> fn3, Function<? super T, ? extends U4> fn4) {
requireNonNull(executor, "executor is null");
Expand Down Expand Up @@ -2332,11 +2332,11 @@ public static <T, U1, U2, U3, U4> CompletableFuture<Tuple4<U1, U2, U3, U4>> tupl
* @param <U5> the function return type
* @return the new CompletableFuture
*/
public static <T, U1, U2, U3, U4, U5> CompletableFuture<Tuple5<U1, U2, U3, U4, U5>> tupleMApplyMostSuccessAsync(
public static <T, U1, U2, U3, U4, U5> CompletableFuture<Tuple5<U1, U2, U3, U4, U5>> thenTupleMApplyMostSuccessAsync(
CompletionStage<? extends T> cf, long timeout, TimeUnit unit, Function<? super T, ? extends U1> fn1,
Function<? super T, ? extends U2> fn2, Function<? super T, ? extends U3> fn3, Function<? super T, ? extends U4> fn4,
Function<? super T, ? extends U5> fn5) {
return tupleMApplyMostSuccessAsync(cf, AsyncPoolHolder.ASYNC_POOL, timeout, unit, fn1, fn2, fn3, fn4, fn5);
return thenTupleMApplyMostSuccessAsync(cf, AsyncPoolHolder.ASYNC_POOL, timeout, unit, fn1, fn2, fn3, fn4, fn5);
}

/**
Expand Down Expand Up @@ -2364,7 +2364,7 @@ public static <T, U1, U2, U3, U4, U5> CompletableFuture<Tuple5<U1, U2, U3, U4, U
* @param <U5> the function return type
* @return the new CompletableFuture
*/
public static <T, U1, U2, U3, U4, U5> CompletableFuture<Tuple5<U1, U2, U3, U4, U5>> tupleMApplyMostSuccessAsync(
public static <T, U1, U2, U3, U4, U5> CompletableFuture<Tuple5<U1, U2, U3, U4, U5>> thenTupleMApplyMostSuccessAsync(
CompletionStage<? extends T> cf, Executor executor, long timeout, TimeUnit unit, Function<? super T, ? extends U1> fn1,
Function<? super T, ? extends U2> fn2, Function<? super T, ? extends U3> fn3, Function<? super T, ? extends U4> fn4,
Function<? super T, ? extends U5> fn5) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -848,17 +848,17 @@ void test_tupleMApplyMostSuccessAsync() throws Exception {
sleep(100);
return n + n;
};
assertEquals(Tuple2.of(n, s), tupleMApplyMostSuccessAsync(completed, 100, TimeUnit.MILLISECONDS, function_n, function_s).get());
assertEquals(Tuple2.of(n, s), tupleMApplyMostSuccessAsync(completed, defaultExecutor(), 100, TimeUnit.MILLISECONDS, function_n, function_s).get());
assertEquals(Tuple2.of(n, s), thenTupleMApplyMostSuccessAsync(completed, 100, TimeUnit.MILLISECONDS, function_n, function_s).get());
assertEquals(Tuple2.of(n, s), thenTupleMApplyMostSuccessAsync(completed, defaultExecutor(), 100, TimeUnit.MILLISECONDS, function_n, function_s).get());

assertEquals(Tuple3.of(n, s, d), tupleMApplyMostSuccessAsync(completed, 100, TimeUnit.MILLISECONDS, function_n, function_s, function_d).get());
assertEquals(Tuple3.of(n, s, d), tupleMApplyMostSuccessAsync(completed, defaultExecutor(), 100, TimeUnit.MILLISECONDS, function_n, function_s, function_d).get());
assertEquals(Tuple3.of(n, s, d), thenTupleMApplyMostSuccessAsync(completed, 100, TimeUnit.MILLISECONDS, function_n, function_s, function_d).get());
assertEquals(Tuple3.of(n, s, d), thenTupleMApplyMostSuccessAsync(completed, defaultExecutor(), 100, TimeUnit.MILLISECONDS, function_n, function_s, function_d).get());

assertEquals(Tuple4.of(n, s, d, anotherN), tupleMApplyMostSuccessAsync(completed, 100, TimeUnit.MILLISECONDS, function_n, function_s, function_d, function_an).get());
assertEquals(Tuple4.of(n, s, d, anotherN), tupleMApplyMostSuccessAsync(completed, defaultExecutor(), 100, TimeUnit.MILLISECONDS, function_n, function_s, function_d, function_an).get());
assertEquals(Tuple4.of(n, s, d, anotherN), thenTupleMApplyMostSuccessAsync(completed, 100, TimeUnit.MILLISECONDS, function_n, function_s, function_d, function_an).get());
assertEquals(Tuple4.of(n, s, d, anotherN), thenTupleMApplyMostSuccessAsync(completed, defaultExecutor(), 100, TimeUnit.MILLISECONDS, function_n, function_s, function_d, function_an).get());

assertEquals(Tuple5.of(n, s, d, anotherN, n + n), tupleMApplyMostSuccessAsync(completed, 100, TimeUnit.MILLISECONDS, function_n, function_s, function_d, function_an, function_nn).get());
assertEquals(Tuple5.of(n, s, d, anotherN, n + n), tupleMApplyMostSuccessAsync(completed, defaultExecutor(), 100, TimeUnit.MILLISECONDS, function_n, function_s, function_d, function_an, function_nn).get());
assertEquals(Tuple5.of(n, s, d, anotherN, n + n), thenTupleMApplyMostSuccessAsync(completed, 100, TimeUnit.MILLISECONDS, function_n, function_s, function_d, function_an, function_nn).get());
assertEquals(Tuple5.of(n, s, d, anotherN, n + n), thenTupleMApplyMostSuccessAsync(completed, defaultExecutor(), 100, TimeUnit.MILLISECONDS, function_n, function_s, function_d, function_an, function_nn).get());
}

@Test
Expand Down

0 comments on commit 6993c42

Please sign in to comment.