There is conflicting information about when and whether to use subscribeOn using Retrofit.
Here is the answer saying not to use subscribeOn .
Here is an answer that seems to imply that subscribeOn does not have a good default set.
Here is sample code using subscribeOn .
So, once for all, when should I use subscribeOn and with which stream? What are the possible consequences of using or not using subscribeOn ?
apiService.issueRequest() // Is this useful? Required? Bad practice? .subscribeOn(Schedulers.io()) // Do actions on main thread .observeOn(AndroidSchedulers.mainThread()) .subscribe(new Action1<Response>() { @Override public void call(Response response) { handleResponse(response); });
source share