Skip to content

Commit

Permalink
! update after release v1.0.0-Alpha2
Browse files Browse the repository at this point in the history
  • Loading branch information
oldratlee committed May 4, 2024
1 parent 28a4a12 commit 1a76eb3
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 18 deletions.
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -561,18 +561,18 @@ public class ConcurrencyStrategyDemo {
<dependency>
<groupId>io.foldright</groupId>
<artifactId>cffu</artifactId>
<version>1.0.0-Alpha1</version>
<version>1.0.0-Alpha2</version>
</dependency>
```
- For `Gradle` projects:

```groovy
// Gradle Kotlin DSL
implementation("io.foldright:cffu:1.0.0-Alpha1")
implementation("io.foldright:cffu:1.0.0-Alpha2")
```
```groovy
// Gradle Groovy DSL
implementation 'io.foldright:cffu:1.0.0-Alpha1'
implementation 'io.foldright:cffu:1.0.0-Alpha2'
```
- `cffu Kotlin`支持库:
- For `Maven` projects:
Expand All @@ -581,18 +581,18 @@ public class ConcurrencyStrategyDemo {
<dependency>
<groupId>io.foldright</groupId>
<artifactId>cffu-kotlin</artifactId>
<version>1.0.0-Alpha1</version>
<version>1.0.0-Alpha2</version>
</dependency>
```
- For `Gradle` projects:

```groovy
// Gradle Kotlin DSL
implementation("io.foldright:cffu-kotlin:1.0.0-Alpha1")
implementation("io.foldright:cffu-kotlin:1.0.0-Alpha2")
```
```groovy
// Gradle Groovy DSL
implementation 'io.foldright:cffu-kotlin:1.0.0-Alpha1'
implementation 'io.foldright:cffu-kotlin:1.0.0-Alpha2'
```
- `cffu bom`:
- For `Maven` projects:
Expand All @@ -601,7 +601,7 @@ public class ConcurrencyStrategyDemo {
<dependency>
<groupId>io.foldright</groupId>
<artifactId>cffu-bom</artifactId>
<version>1.0.0-Alpha1</version>
<version>1.0.0-Alpha2</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand All @@ -610,11 +610,11 @@ public class ConcurrencyStrategyDemo {

```groovy
// Gradle Kotlin DSL
implementation(platform("io.foldright:cffu-bom:1.0.0-Alpha1"))
implementation(platform("io.foldright:cffu-bom:1.0.0-Alpha2"))
```
```groovy
// Gradle Groovy DSL
implementation platform('io.foldright:cffu-bom:1.0.0-Alpha1')
implementation platform('io.foldright:cffu-bom:1.0.0-Alpha2')
```
- [📌 `TransmittableThreadLocal(TTL)`](https://github.com/alibaba/transmittable-thread-local)的[`cffu executor wrapper SPI`实现](cffu-ttl-executor-wrapper):
- For `Maven` projects:
Expand All @@ -623,19 +623,19 @@ public class ConcurrencyStrategyDemo {
<dependency>
<groupId>io.foldright</groupId>
<artifactId>cffu-ttl-executor-wrapper</artifactId>
<version>1.0.0-Alpha1</version>
<version>1.0.0-Alpha2</version>
<scope>runtime</scope>
</dependency>
```
- For `Gradle` projects:

```groovy
// Gradle Kotlin DSL
runtimeOnly("io.foldright:cffu-ttl-executor-wrapper:1.0.0-Alpha1")
runtimeOnly("io.foldright:cffu-ttl-executor-wrapper:1.0.0-Alpha2")
```
```groovy
// Gradle Groovy DSL
runtimeOnly 'io.foldright:cffu-ttl-executor-wrapper:1.0.0-Alpha1'
runtimeOnly 'io.foldright:cffu-ttl-executor-wrapper:1.0.0-Alpha2'
```

# 📚 更多资料
Expand Down
3 changes: 3 additions & 0 deletions cffu-core/src/main/java/io/foldright/cffu/CffuFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ public <T> Cffu<T> newIncompleteCffu() {
* <li>otherwise use input {@code stage.toCompletableFuture} as the underlying cf of returned cffu.
* </ol>
*
* @throws NullPointerException if the given stage is null
* @see #toCffuArray(CompletionStage[])
* @see CompletionStage#toCompletableFuture()
* @see Cffu#cffuUnwrap()
Expand All @@ -278,11 +279,13 @@ public <T> Cffu<T> toCffu(CompletionStage<T> stage) {
* A convenient util method for wrap input {@link CompletableFuture} / {@link CompletionStage} / {@link Cffu}
* array element by {@link #toCffu(CompletionStage)}.
*
* @throws NullPointerException if the array or any of its elements are {@code null}
* @see #toCffu(CompletionStage)
*/
@Contract(pure = true)
@SafeVarargs
public final <T> Cffu<T>[] toCffuArray(CompletionStage<T>... stages) {
requireNonNull(stages, "stages is null");
@SuppressWarnings("unchecked")
Cffu<T>[] ret = new Cffu[stages.length];
for (int i = 0; i < stages.length; i++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1029,6 +1029,7 @@ public static <T> CompletableFuture<T> failedFuture(Throwable ex) {
if (IS_JAVA9_PLUS) {
return CompletableFuture.failedFuture(ex);
}
requireNonNull(ex, "ex is null");
final CompletableFuture<T> cf = new CompletableFuture<>();
cf.completeExceptionally(ex);
return cf;
Expand Down Expand Up @@ -1215,7 +1216,6 @@ public static <T> CompletableFuture<T> exceptionallyCompose(
if (IS_JAVA12_PLUS) {
return cf.exceptionallyCompose(fn);
}

requireNonNull(fn, "fn is null");
// below code is copied from CompletionStage.exceptionallyCompose
return cf.handle((r, ex) -> (ex == null) ? cf : fn.apply(ex)).thenCompose(identity());
Expand Down Expand Up @@ -1249,7 +1249,6 @@ public static <T> CompletableFuture<T> exceptionallyComposeAsync(
if (IS_JAVA12_PLUS) {
return cf.exceptionallyComposeAsync(fn, executor);
}

requireNonNull(fn, "fn is null");
requireNonNull(executor, "executor is null");
// below code is copied from CompletionStage.exceptionallyComposeAsync
Expand Down Expand Up @@ -1294,7 +1293,6 @@ public static <T> CompletableFuture<T> exceptionallyComposeAsync(
@Nullable
public static <T> T join(CompletableFuture<T> cf, long timeout, TimeUnit unit) {
if (cf.isDone()) return cf.join();

return orTimeout(copy(cf), timeout, unit).join();
}

Expand Down Expand Up @@ -1536,6 +1534,7 @@ public static Executor defaultExecutor() {
@Contract(pure = true)
@SafeVarargs
public static <T> CompletableFuture<T>[] toCompletableFutureArray(CompletionStage<T>... stages) {
requireNonNull(stages, "stages is null");
@SuppressWarnings("unchecked")
CompletableFuture<T>[] ret = new CompletableFuture[stages.length];
for (int i = 0; i < stages.length; i++) {
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-Alpha1</version>
<version>1.0.0-Alpha2</version>
</dependency>
```

For `Gradle` projects:

```groovy
// Gradle Kotlin DSL
runtimeOnly("io.foldright:cffu-ttl-executor-wrapper:1.0.0-Alpha1")
runtimeOnly("io.foldright:cffu-ttl-executor-wrapper:1.0.0-Alpha2")
```

```groovy
// Gradle Groovy DSL
runtimeOnly 'io.foldright:cffu-ttl-executor-wrapper:1.0.0-Alpha1'
runtimeOnly 'io.foldright:cffu-ttl-executor-wrapper:1.0.0-Alpha2'
```

`cffu-ttl-executor-wrapper` has published to maven central, find the latest version at
Expand Down

0 comments on commit 1a76eb3

Please sign in to comment.