Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Observable is not respecting subscribeOn #430
In an Android app, I am using retrofit's observables. I am running into an issue where the observable is not respecting my observeOn. Here is what I am hoping my code would look like:
RestAdapter restAdapter = new RestAdapter.Builder()
Right now I believe I have a few options to get network off the main thread. I can wrap this in a callable which executes on a different thread. I can have my Api return Foo and build my own Observable. Or I can pass in an httpExecutor and callbackExecutor to my restAdapter.
I feel like none of those solutions look as clean as my sample code.
We do this many times:
apiManager.getFoo() .observeOn(AndroidSchedulers.mainThread()) .subscribe(u -> println(u))
and it works perfectly.
Yep! You got it.
On Wed, Feb 24, 2016 at 5:43 PM Brian firstname.lastname@example.org wrote:
Just to clarify: is it enough to just set default scheduler in my
Do these calls effectively duplicate each other's behavior in this case?
My goal is simply to make an async network call and report the result back to the main thread.