@Test public void emptySource() { AtomicInteger calls = new AtomicInteger(); TestSubscriber<Integer> ts = new TestSubscriber<>(); Single.empty() .flatMap(v -> { calls.getAndIncrement(); return Multi.just(1, 2, 3); }) .subscribe(ts); ; ts.assertResult(); assertThat(calls.get(), is(0)); }
@Override public void subscribe(Flow.Subscriber<? super R> subscriber) { source.subscribe(new FlatMapSubscriber<>(subscriber, mapper)); }
SingleFlatMapMulti implements Multi<R> { @Override public void subscribe(Flow.Subscriber<? super R> subscriber) { source.subscribe(new FlatMapSubscriber<>(subscriber, mapper)); } }
SingleFlatMapMulti implements Multi<R> { @Override public void subscribe(Flow.Subscriber<? super R> subscriber) { source.subscribe(new FlatMapSubscriber<>(subscriber, mapper)); } SingleFlatMapMulti(Single<T> source,
                       Function<? super T, ? extends Flow.Publisher<? extends R>> mapper); }
SingleFlatMapMulti implements Multi<R> { @Override public void subscribe(Flow.Subscriber<? super R> subscriber) { source.subscribe(new FlatMapSubscriber<>(subscriber, mapper)); } SingleFlatMapMulti(Single<T> source,
                       Function<? super T, ? extends Flow.Publisher<? extends R>> mapper); @Override void subscribe(Flow.Subscriber<? super R> subscriber); }
SingleFlatMapMulti implements Multi<R> { @Override public void subscribe(Flow.Subscriber<? super R> subscriber) { source.subscribe(new FlatMapSubscriber<>(subscriber, mapper)); } SingleFlatMapMulti(Single<T> source,
                       Function<? super T, ? extends Flow.Publisher<? extends R>> mapper); @Override void subscribe(Flow.Subscriber<? super R> subscriber);  }