From 36fa64879f13015e664e800a50afcc69b3258663 Mon Sep 17 00:00:00 2001 From: Jerry Lee Date: Sun, 2 Jun 2024 19:26:16 +0800 Subject: [PATCH] ! update after release `v1.0.0-Alpha8` --- README.md | 24 +++++++++---------- .../cffu/CompletableFutureUtils.java | 14 +++++------ cffu-ttl-executor-wrapper/README.md | 6 ++--- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 630067fd..9a40034d 100644 --- a/README.md +++ b/README.md @@ -560,18 +560,18 @@ public class ConcurrencyStrategyDemo { io.foldright cffu - 1.0.0-Alpha7 + 1.0.0-Alpha8 ``` - For `Gradle` projects: ```groovy // Gradle Kotlin DSL - implementation("io.foldright:cffu:1.0.0-Alpha7") + implementation("io.foldright:cffu:1.0.0-Alpha8") ``` ```groovy // Gradle Groovy DSL - implementation 'io.foldright:cffu:1.0.0-Alpha7' + implementation 'io.foldright:cffu:1.0.0-Alpha8' ``` - `cffu Kotlin`支持库: - For `Maven` projects: @@ -580,18 +580,18 @@ public class ConcurrencyStrategyDemo { io.foldright cffu-kotlin - 1.0.0-Alpha7 + 1.0.0-Alpha8 ``` - For `Gradle` projects: ```groovy // Gradle Kotlin DSL - implementation("io.foldright:cffu-kotlin:1.0.0-Alpha7") + implementation("io.foldright:cffu-kotlin:1.0.0-Alpha8") ``` ```groovy // Gradle Groovy DSL - implementation 'io.foldright:cffu-kotlin:1.0.0-Alpha7' + implementation 'io.foldright:cffu-kotlin:1.0.0-Alpha8' ``` - `cffu bom`: - For `Maven` projects: @@ -600,7 +600,7 @@ public class ConcurrencyStrategyDemo { io.foldright cffu-bom - 1.0.0-Alpha7 + 1.0.0-Alpha8 pom import @@ -609,11 +609,11 @@ public class ConcurrencyStrategyDemo { ```groovy // Gradle Kotlin DSL - implementation(platform("io.foldright:cffu-bom:1.0.0-Alpha7")) + implementation(platform("io.foldright:cffu-bom:1.0.0-Alpha8")) ``` ```groovy // Gradle Groovy DSL - implementation platform('io.foldright:cffu-bom:1.0.0-Alpha7') + implementation platform('io.foldright:cffu-bom:1.0.0-Alpha8') ``` - [📌 `TransmittableThreadLocal(TTL)`](https://github.com/alibaba/transmittable-thread-local)的[`cffu executor wrapper SPI`实现](cffu-ttl-executor-wrapper): - For `Maven` projects: @@ -622,7 +622,7 @@ public class ConcurrencyStrategyDemo { io.foldright cffu-ttl-executor-wrapper - 1.0.0-Alpha7 + 1.0.0-Alpha8 runtime ``` @@ -630,11 +630,11 @@ public class ConcurrencyStrategyDemo { ```groovy // Gradle Kotlin DSL - runtimeOnly("io.foldright:cffu-ttl-executor-wrapper:1.0.0-Alpha7") + runtimeOnly("io.foldright:cffu-ttl-executor-wrapper:1.0.0-Alpha8") ``` ```groovy // Gradle Groovy DSL - runtimeOnly 'io.foldright:cffu-ttl-executor-wrapper:1.0.0-Alpha7' + runtimeOnly 'io.foldright:cffu-ttl-executor-wrapper:1.0.0-Alpha8' ``` # 📚 更多资料 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 fe7d6a6a..f5202a9b 100644 --- a/cffu-core/src/main/java/io/foldright/cffu/CompletableFutureUtils.java +++ b/cffu-core/src/main/java/io/foldright/cffu/CompletableFutureUtils.java @@ -68,7 +68,7 @@ public static CompletableFuture allOf(CompletionStage... cfs) { requireNonNull(cfs, "cfs is null"); if (cfs.length == 0) return completedFuture(null); // Defensive copy input cf to non-minimal-stage instance(toNonMinCfCopy) for SINGLE input - // in order to ensure that the returned cf is not non-minimal-stage CF instance(UnsupportedOperationException) + // in order to ensure that the returned cf is not minimal-stage CF instance(UnsupportedOperationException) if (cfs.length == 1) return toNonMinCfCopy(requireNonNull(cfs[0], "cf1 is null")).thenApply(unused -> null); return CompletableFuture.allOf(f_toCfArray(cfs)); } @@ -96,7 +96,7 @@ public static CompletableFuture> allResultsOf(CompletionStage allOfFastFail(CompletionStage... cfs) { final int size = cfs.length; if (size == 0) return completedFuture(null); // Defensive copy input cf to non-minimal-stage instance for SINGLE input in order to ensure that - // the returned cf is not non-minimal-stage CF instance(UnsupportedOperationException) + // the returned cf is not minimal-stage CF instance(UnsupportedOperationException) if (size == 1) return toNonMinCfCopy(cfs[0]).thenApply(unused -> null); final CompletableFuture[] successOrBeIncomplete = new CompletableFuture[size]; @@ -184,7 +184,7 @@ public static CompletableFuture> allResultsOfFastFail(CompletionStag final int size = cfs.length; if (size == 0) return completedFuture(arrayList()); // Defensive copy input cf to non-minimal-stage instance(toNonMinCfCopy) for SINGLE input - // in order to ensure that the returned cf is not non-minimal-stage CF instance(UnsupportedOperationException) + // in order to ensure that the returned cf is not minimal-stage CF instance(UnsupportedOperationException) if (size == 1) return toNonMinCfCopy(cfs[0]).thenApply(CompletableFutureUtils::arrayList); final CompletableFuture[] successOrBeIncomplete = new CompletableFuture[size]; @@ -245,7 +245,7 @@ public static CompletableFuture> mostResultsOfSuccess( if (cfs.length == 1) { // Defensive copy input cf to non-minimal-stage instance in order to // 1. avoid writing it by `completeOnTimeout` and is able to read its result(`getSuccessNow`) - // 2. ensure that the returned cf is not non-minimal-stage CF instance(UnsupportedOperationException) + // 2. ensure that the returned cf is not minimal-stage CF instance(UnsupportedOperationException) final CompletableFuture f = toNonMinCfCopy(requireNonNull(cfs[0], "cf1 is null")); return cffuOrTimeout(f, executorWhenTimeout, timeout, unit) .handle((unused, ex) -> arrayList(getSuccessNow(f, valueIfNotSuccess))); @@ -426,7 +426,7 @@ public static CompletableFuture anyOf(CompletionStage... cfs if (cfs.length == 0) return new CompletableFuture<>(); // Defensive copy input cf to non-minimal-stage instance for SINGLE input in order to ensure that // 1. avoid writing the input cf unexpectedly it by caller code - // 2. the returned cf is not non-minimal-stage CF instance(UnsupportedOperationException) + // 2. the returned cf is not minimal-stage CF instance(UnsupportedOperationException) if (cfs.length == 1) return toNonMinCfCopy(requireNonNull(cfs[0], "cf1 is null")); CompletableFuture ret = CompletableFuture.anyOf(f_toCfArray(cfs)); return f_cast(ret); @@ -456,7 +456,7 @@ public static CompletableFuture anyOfSuccess(CompletionStage if (size == 0) return failedFuture(new NoCfsProvidedException()); // Defensive copy input cf to non-minimal-stage instance for SINGLE input in order to ensure that // 1. avoid writing the input cf unexpectedly it by caller code - // 2. the returned cf is not non-minimal-stage CF instance(UnsupportedOperationException) + // 2. the returned cf is not minimal-stage CF instance(UnsupportedOperationException) if (size == 1) return toNonMinCfCopy(cfs[0]); // NOTE: fill ONE MORE element of successOrBeIncompleteCfs LATER diff --git a/cffu-ttl-executor-wrapper/README.md b/cffu-ttl-executor-wrapper/README.md index 766ca8c5..007c5000 100644 --- a/cffu-ttl-executor-wrapper/README.md +++ b/cffu-ttl-executor-wrapper/README.md @@ -18,7 +18,7 @@ For `Maven` projects: io.foldright cffu-ttl-executor-wrapper runtime - 1.0.0-Alpha7 + 1.0.0-Alpha8 ``` @@ -26,12 +26,12 @@ For `Gradle` projects: ```groovy // Gradle Kotlin DSL -runtimeOnly("io.foldright:cffu-ttl-executor-wrapper:1.0.0-Alpha7") +runtimeOnly("io.foldright:cffu-ttl-executor-wrapper:1.0.0-Alpha8") ``` ```groovy // Gradle Groovy DSL -runtimeOnly 'io.foldright:cffu-ttl-executor-wrapper:1.0.0-Alpha7' +runtimeOnly 'io.foldright:cffu-ttl-executor-wrapper:1.0.0-Alpha8' ``` `cffu-ttl-executor-wrapper` has published to maven central, find the latest version at