Created
November 28, 2019 14:23
-
-
Save jeroenr/3326d42c87d5b995492c4ea95d8bdd99 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface Service { | |
Flux<String> observe(); | |
Mono<Void> save(String s); | |
} | |
class Foo { | |
private final Service service; | |
void longRunningProblem() { | |
service.observe() | |
.flatMap(service::save, 10) | |
.doOnTerminate(this::longRunningProblem) // start over on terminate | |
.subscribeOn(Schedulers.elastic()) | |
.retry() // retry indefinitely | |
.subscribe(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment