These are chat archives for ReactiveX/RxJava

4th
Oct 2017
Amr Elmasry
@AmrElmasry
Oct 04 2017 18:13

Hello, I have a question about the operators implementation,

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

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 ?