June 2017
Intermediate to advanced
400 pages
8h 44m
English
It is important to note that subscribeOn() will have no practical effect with certain sources (and will keep a worker thread unnecessarily on standby until that operation terminates). This might be because these Observables already use a specific Scheduler, and if you want to change it, you can provide a Scheduler as an argument. For example, Observable.interval() will use Schedulers.computation() and will ignore any subscribeOn()you specify otherwise. But you can provide a third argument to specify a different Scheduler to use. Here, I specify Observable.interval() to use Schedulers.newThread(), as shown here:
import io.reactivex.Observable;import io.reactivex.schedulers.Schedulers;import java.util.concurrent.
Read now
Unlock full access