Thanks for using RxJava but before you post an issue, please consider the following points:
2.x) that would be great.-> compile 'io.reactivex.rxjava2:rxjava:2.0.3'
-> This test is green.
Expected that disposable.size is 1. Like in CompositeSuubscription from RxJava 1.
@Test
public void name() throws Exception {
final TestObserver<Integer> firstTestObserver = new TestObserver<>();
firstTestObserver.dispose();
final TestObserver<Integer> secondTestObserver = new TestObserver<>();
assertThat(firstTestObserver.isDisposed(), is(equalTo(true)));
assertThat(secondTestObserver.isDisposed(), is(equalTo(false)));
final CompositeDisposable disposable = new CompositeDisposable();
disposable.addAll(firstTestObserver, secondTestObserver);
assertThat(disposable.size(), is(equalTo(2)));
}
-> I expect that the CompositeDisposable don't add an already disposed Disposable.
Like the CompsositeSubscription.
We don't do that anymore and the expected behavior is now deferred to the developer:
if (!firstTestObserver.isDisposed()) {
disposable.add(firstTestObserver);
}
OK, when it is expected from your side it is ok for me 馃槃 鉂わ笍
Thanks for the fast response 馃憥
@akarnokd can you go into detail why it is beneficial to hold a reference to an already disposed Disposable?
Why would you try to add them in the first place if you know they are disposed?