[concurrency-interest] CompletableFuture.stopIf

federico.fissore at gmail.com federico.fissore at gmail.com
Fri Sep 2 08:08:36 EDT 2016


Dávid Karnok ha scritto il 02/09/2016 alle 13:15:
> Have you considered using Reactor-Core (Java 8+) instead? Assuming your
> methods return CompletableFuture
>
> Mono.fromFuture(fetchUser(id))
> .filter(user -> user != null)
> .flatMap(user ->
>     Mono.fromFuture(changeEmail(user))
>     .then(Mono.fromFuture(notifyOtherSystemsOfNewEmail(user)))
> )
> .subscribe(v -> { }, e -> log.error(e));
>

Ah that's a nice syntax. Thank you. I didn't know about reactor-core

Federico


More information about the Concurrency-interest mailing list