@Test public void cancelInOnNext() { TestSubscriber<Integer> ts = new TestSubscriber<>() { @Override public void onNext(Integer item) { super.onNext(item); getSubcription().cancel(); super.onComplete(); } }; Single.just(1).flatMapIterable(v -> Collections.singleton(1)) .subscribe(ts); ts.requestMax(); assertEquals(ts.getItems(), Collections.singleton(1)); assertThat(ts.isComplete(), is(true)); assertThat(ts.getLastError(), is(nullValue())); }
@Override public void subscribe(Flow.Subscriber<? super R> subscriber) { source.subscribe(new FlatMapIterableSubscriber<>(subscriber, mapper)); }
SingleFlatMapIterable implements Multi<R> { @Override public void subscribe(Flow.Subscriber<? super R> subscriber) { source.subscribe(new FlatMapIterableSubscriber<>(subscriber, mapper)); } }
SingleFlatMapIterable implements Multi<R> { @Override public void subscribe(Flow.Subscriber<? super R> subscriber) { source.subscribe(new FlatMapIterableSubscriber<>(subscriber, mapper)); } SingleFlatMapIterable(Single<T> source, Function<? super T, ? extends Iterable<? extends R>> mapper); }
SingleFlatMapIterable implements Multi<R> { @Override public void subscribe(Flow.Subscriber<? super R> subscriber) { source.subscribe(new FlatMapIterableSubscriber<>(subscriber, mapper)); } SingleFlatMapIterable(Single<T> source, Function<? super T, ? extends Iterable<? extends R>> mapper); @Override void subscribe(Flow.Subscriber<? super R> subscriber); }
SingleFlatMapIterable implements Multi<R> { @Override public void subscribe(Flow.Subscriber<? super R> subscriber) { source.subscribe(new FlatMapIterableSubscriber<>(subscriber, mapper)); } SingleFlatMapIterable(Single<T> source, Function<? super T, ? extends Iterable<? extends R>> mapper); @Override void subscribe(Flow.Subscriber<? super R> subscriber);  }