Skip to content
This repository has been archived by the owner on Jun 15, 2023. It is now read-only.

Commit

Permalink
Issue #15: Switch to Reactor 3.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
magnet committed Oct 16, 2017
1 parent 3c06918 commit a7ca0ab
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

<properties>
<primeval-commons.version>1.1.0-SNAPSHOT</primeval-commons.version>
<reactor-core.version>3.0.7.RELEASE</reactor-core.version>
<reactor-core.version>3.1.0.RELEASE</reactor-core.version>
</properties>

<dependencies>
Expand All @@ -30,7 +30,7 @@
<artifactId>primeval-commons</artifactId>
<version>${primeval-commons.version}</version>
</dependency>

<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.core</artifactId>
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/io/primeval/codex/promise/PromiseHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -194,16 +194,16 @@ public static <T> Mono<T> toMonoOptional(Promise<Optional<T>> promise) {
}

public static <T> Mono<T> toMono(Callable<Promise<T>> promise) {
return Mono.fromCallable(promise).then(PromiseHelper::toMono);
return Mono.fromCallable(promise).flatMap(PromiseHelper::toMono);
}

public static <T> Mono<T> toMonoOptional(Callable<Promise<Optional<T>>> promise) {
return Mono.fromCallable(promise).then(PromiseHelper::toMonoOptional);
return Mono.fromCallable(promise).flatMap(PromiseHelper::toMonoOptional);
}

public static <T> Promise<T> fromMono(Mono<T> mono) {
Deferred<T> deferred = new Deferred<>();
mono.doOnTerminate((value, error) -> {
mono.doOnSuccessOrError((value, error) -> {
if (error != null) {
deferred.fail(error);
} else {
Expand Down

0 comments on commit a7ca0ab

Please sign in to comment.