I have an Android app based on MVP + interactors + repositories. All layers from repository to presenter are wired using reactive streams (RxJava 2). View requests something from presenter, presenter asks from interactor, interactor asks from repository and repository asks from API itself. Response passes through the same layers as reactive stream from API to presenter. Each layer can map data for underlying layer.
The question is. Where should I call subscribeOn(io()/computation()/etc) and observeOn(AndroidSchedulers.mainThread()) ? I think that observeOn(AndroidSchedulers.mainThread()) should be called from presenter because heavy computings could be performed in interactor. In many examples subscribeOn(io()/computation()/etc) is called from presenter, but I don't agree with this approach. I think that presenter shouldn't decide in which thread to load data. Repository should decide in which thread to load data from API. For example if we have the repository interface to load contacts. An implementation can get data from DB or Internet or in-memory storage. There is no need to create thread for in-memory repository. So repository should decide whether subscribe on io/computation/etc scheduler or not.
Any ideas?