Hello,
I'm working on improving my understanding of subscribeOn. In particular, I'm curious why multiple calls to subscribeOn yields no results (it only registers the first call):
Observable.just(1, 2, 3)
.subscribeOn(Schedulers.newThread())
.subscribeOn(Schedulers.io())
.subscribe(System.out::println);
Everything ends up on whatever Schedulers.newThread() produces. This is different from observeOn, which allows multiple calls for switching schedulers.
The only way I've figured out to switch the subscribeOn Scheduler is to use flatMap and use subscribeOn for the return Observable. It doesn't entirely make sense to me why that works when this won't work: subscribeOn().flatMap().subscribeOn()
I know these are somewhat contrived examples, as I don't have a particular use for this. I'm just trying to understand RxJava better.
Thanks,
Dan