@Test public void cancelUpfront() { TestSubscriber<Object> ts = new TestSubscriber<>(); ts.cancel(); Single.just(1) .takeUntil(Single.error(new IOException())) .subscribe(ts); ts.assertEmpty(); }
@Override public void subscribe(Flow.Subscriber<? super T> subscriber) { Objects.requireNonNull(subscriber, "subscriber is null"); MultiTakeUntilPublisher.TakeUntilMainSubscriber<T> parent = new MultiTakeUntilPublisher.TakeUntilMainSubscriber<>(subscriber); subscriber.onSubscribe(parent); other.subscribe(parent.other()); source.subscribe(parent); }
SingleTakeUntilPublisher extends CompletionSingle<T> { @Override public void subscribe(Flow.Subscriber<? super T> subscriber) { Objects.requireNonNull(subscriber, "subscriber is null"); MultiTakeUntilPublisher.TakeUntilMainSubscriber<T> parent = new MultiTakeUntilPublisher.TakeUntilMainSubscriber<>(subscriber); subscriber.onSubscribe(parent); other.subscribe(parent.other()); source.subscribe(parent); } }
SingleTakeUntilPublisher extends CompletionSingle<T> { @Override public void subscribe(Flow.Subscriber<? super T> subscriber) { Objects.requireNonNull(subscriber, "subscriber is null"); MultiTakeUntilPublisher.TakeUntilMainSubscriber<T> parent = new MultiTakeUntilPublisher.TakeUntilMainSubscriber<>(subscriber); subscriber.onSubscribe(parent); other.subscribe(parent.other()); source.subscribe(parent); } SingleTakeUntilPublisher(Single<T> source, Flow.Publisher<U> other); }
SingleTakeUntilPublisher extends CompletionSingle<T> { @Override public void subscribe(Flow.Subscriber<? super T> subscriber) { Objects.requireNonNull(subscriber, "subscriber is null"); MultiTakeUntilPublisher.TakeUntilMainSubscriber<T> parent = new MultiTakeUntilPublisher.TakeUntilMainSubscriber<>(subscriber); subscriber.onSubscribe(parent); other.subscribe(parent.other()); source.subscribe(parent); } SingleTakeUntilPublisher(Single<T> source, Flow.Publisher<U> other); @Override void subscribe(Flow.Subscriber<? super T> subscriber); }
SingleTakeUntilPublisher extends CompletionSingle<T> { @Override public void subscribe(Flow.Subscriber<? super T> subscriber) { Objects.requireNonNull(subscriber, "subscriber is null"); MultiTakeUntilPublisher.TakeUntilMainSubscriber<T> parent = new MultiTakeUntilPublisher.TakeUntilMainSubscriber<>(subscriber); subscriber.onSubscribe(parent); other.subscribe(parent.other()); source.subscribe(parent); } SingleTakeUntilPublisher(Single<T> source, Flow.Publisher<U> other); @Override void subscribe(Flow.Subscriber<? super T> subscriber);  }