Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Writing the same code using RxJava Observable
@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