Is it possible to achieve something like this with RxJava, and if so - how:
- There is chain of Rx operators, which is subscribed to with proper
subscribeOnandobserveOn - Inside the chain, there is a need to execute something on particular scheduler (different from those mentioned above)
- After the above p2 is executed, chain must continue on whatever schedulers specified as part of subscription
Yes, it's possible. Just use the
observeOn()operator multiple times.Example:
And the output is:
You can see that the two map operation happened in two different threads.