These are chat archives for ReactiveX/RxJava

Oct 2017
Amr Elmasry
Oct 04 2017 18:13

Hello, I have a question about the operators implementation,

        public void onSubscribe(Disposable s) {
            if (DisposableHelper.validate(this.s, s)) {
                this.s = s;

I understand that this line DisposableHelper.validate(this.s, s) is to assert that the value from upstream isn't null and it wasn't set before, but why in this line actual.onSubscribe(this); we passed this ? why not just passing s ? what is the need for implementing Disposable ?