Rxjava can change the thread schedule of observable and subscriber with the observeOn method and the subscribeOn method.
The observeOn and subscribeOn use the lift method to return a new Observable.
The lift method will create a new observable, I think it like a clone method,it will create a new subscriber and a new OnSubscribe.
In observeOn():the new OnSubscribe will notify the old OnSubscribe to send messages to the new subscriber and the new subscriber will change its thread scheduler when it gets the message.After this, the new subscriber will send messages to the old subscriber.
In subscribeOn():The new OnSubscribe will change its thread scheduler first and then it'll notify the old OnSubscribe.........and so on.
My question is why the subscribeOn() change its thread scheduler in the new OnSubscribe first and the observeOn() change its thread scheduler when the new subscriber get messages from the old onSubscriber? Why the creator designed it like this? Why the place of changing thread scheduler in subscribeOn and observeOn is different?
Thanks in advance