Skip to content

Instantly share code, notes, and snippets.

@maggandalf
Created July 5, 2014 16:19
Show Gist options
  • Save maggandalf/e62a746d4b8d2b7c4fa8 to your computer and use it in GitHub Desktop.
Save maggandalf/e62a746d4b8d2b7c4fa8 to your computer and use it in GitHub Desktop.
public Observable<JsonObject> getBookInfo(final String isbn) {
return Observable.create((Observable.OnSubscribe<JsonObject>) subscriber -> {
Runnable r = () -> {
subscriber.onNext(bookServiceTarget.path(isbn).request().get(JsonObject.class));
subscriber.onCompleted();
};
executor.execute(r);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment