Created
June 28, 2017 07:19
-
-
Save liviutudor/cf2fcdf18241124c238827e0832f7a46 to your computer and use it in GitHub Desktop.
Writing the same code using RxJava Observable
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
@GET | |
public Observable<Response> processRequest( @QueryParam("id")String id, @QueryParam("userId")String userId ) { | |
return Observable.zip( | |
Observable.fromCallable(() -> database.retrieveRecord(id)), | |
Observable.fromCallable(() -> userStore.retrieve(userId)), | |
Observable.fromCallable(() -> logger.writeEntryFor(id, userId)), | |
this::generateAdResponse | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment