Skip to content

Commit

Permalink
! update after release v1.0.0-Alpha8
Browse files Browse the repository at this point in the history
  • Loading branch information
oldratlee committed Jun 5, 2024
1 parent d23405c commit 36fa648
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 22 deletions.
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -560,18 +560,18 @@ public class ConcurrencyStrategyDemo {
<dependency>
<groupId>io.foldright</groupId>
<artifactId>cffu</artifactId>
<version>1.0.0-Alpha7</version>
<version>1.0.0-Alpha8</version>
</dependency>
```
- 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:
Expand All @@ -580,18 +580,18 @@ public class ConcurrencyStrategyDemo {
<dependency>
<groupId>io.foldright</groupId>
<artifactId>cffu-kotlin</artifactId>
<version>1.0.0-Alpha7</version>
<version>1.0.0-Alpha8</version>
</dependency>
```
- 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:
Expand All @@ -600,7 +600,7 @@ public class ConcurrencyStrategyDemo {
<dependency>
<groupId>io.foldright</groupId>
<artifactId>cffu-bom</artifactId>
<version>1.0.0-Alpha7</version>
<version>1.0.0-Alpha8</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand All @@ -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:
Expand All @@ -622,19 +622,19 @@ public class ConcurrencyStrategyDemo {
<dependency>
<groupId>io.foldright</groupId>
<artifactId>cffu-ttl-executor-wrapper</artifactId>
<version>1.0.0-Alpha7</version>
<version>1.0.0-Alpha8</version>
<scope>runtime</scope>
</dependency>
```
- 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'
```

# 📚 更多资料
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public static CompletableFuture<Void> 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));
}
Expand Down Expand Up @@ -96,7 +96,7 @@ public static <T> CompletableFuture<List<T>> allResultsOf(CompletionStage<? exte
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 Object[] result = new Object[size];
Expand Down Expand Up @@ -142,7 +142,7 @@ public static CompletableFuture<Void> 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];
Expand Down Expand Up @@ -184,7 +184,7 @@ public static <T> CompletableFuture<List<T>> 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];
Expand Down Expand Up @@ -245,7 +245,7 @@ public static <T> CompletableFuture<List<T>> 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<T> f = toNonMinCfCopy(requireNonNull(cfs[0], "cf1 is null"));
return cffuOrTimeout(f, executorWhenTimeout, timeout, unit)
.handle((unused, ex) -> arrayList(getSuccessNow(f, valueIfNotSuccess)));
Expand Down Expand Up @@ -426,7 +426,7 @@ public static <T> CompletableFuture<T> anyOf(CompletionStage<? extends T>... 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<Object> ret = CompletableFuture.anyOf(f_toCfArray(cfs));
return f_cast(ret);
Expand Down Expand Up @@ -456,7 +456,7 @@ public static <T> CompletableFuture<T> anyOfSuccess(CompletionStage<? extends T>
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
Expand Down
6 changes: 3 additions & 3 deletions cffu-ttl-executor-wrapper/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,20 @@ For `Maven` projects:
<groupId>io.foldright</groupId>
<artifactId>cffu-ttl-executor-wrapper</artifactId>
<scope>runtime</scope>
<version>1.0.0-Alpha7</version>
<version>1.0.0-Alpha8</version>
</dependency>
```

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
Expand Down

0 comments on commit 36fa648

Please sign in to comment.