-
-
Save jdamcd/be60918911f6336cc7a1 to your computer and use it in GitHub Desktop.
This file contains 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
Observable<ServiceResult> pollService() { | |
return Observable.interval(2, TimeUnit.SECONDS) | |
.take(3) | |
.flatMap(tick -> fetchResult()) | |
.takeFirst(result -> !result.isProcessing()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment