From 1603ca9ac8caa19a01b1dff1d9ba29d46c547814 Mon Sep 17 00:00:00 2001 From: Jerry Lee Date: Sat, 18 May 2024 22:58:21 +0800 Subject: [PATCH] WIP mostOf* using new `orTimeout` method --- .../main/java/io/foldright/cffu/CompletableFutureUtils.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cffu-core/src/main/java/io/foldright/cffu/CompletableFutureUtils.java b/cffu-core/src/main/java/io/foldright/cffu/CompletableFutureUtils.java index 4ac1f00d..d026eb2b 100644 --- a/cffu-core/src/main/java/io/foldright/cffu/CompletableFutureUtils.java +++ b/cffu-core/src/main/java/io/foldright/cffu/CompletableFutureUtils.java @@ -210,14 +210,14 @@ public static CompletableFuture> mostResultsOfSuccess( // defensive copy input cf in order to // avoid writing it by `completeOnTimeout` and read its result(`getSuccessNow`) final CompletableFuture f = toCfCopy(cfs[0]); - return orTimeout(f, timeout, unit) + return orTimeout(f, timeout, unit, AsyncPoolHolder.ASYNC_POOL) .handle((unused, ex) -> arrayList(getSuccessNow(f, valueIfNotSuccess))); } // MUST be *Non-Minimal* CF instances in order to read results(`getSuccessNow`), // otherwise UnsupportedOperationException final CompletableFuture[] cfArray = f_toNonMinCfArray(cfs); - return orTimeout(CompletableFuture.allOf(cfArray), timeout, unit) + return orTimeout(CompletableFuture.allOf(cfArray), timeout, unit, AsyncPoolHolder.ASYNC_POOL) .handle((unused, ex) -> arrayList(MGetSuccessNow0(valueIfNotSuccess, cfArray))); } @@ -676,7 +676,7 @@ private static CompletableFuture mostTupleOfSuccess0( // MUST be *Non-Minimal* CF instances in order to read results(`getSuccessNow`), // otherwise UnsupportedOperationException final CompletableFuture[] cfArray = f_toNonMinCfArray(css); - return orTimeout(CompletableFuture.allOf(cfArray), timeout, unit) + return orTimeout(CompletableFuture.allOf(cfArray), timeout, unit, AsyncPoolHolder.ASYNC_POOL) .handle((unused, ex) -> tupleOf0(MGetSuccessNow0(null, cfArray))); }