@Test public void flatMapCompletionStage() { TestSubscriber<Integer> ts = new TestSubscriber<>(); Multi.just(CompletableFuture.completedFuture(1), CompletableFuture.completedFuture(2)) .flatMap(Multi::create, 1, false, 1) .subscribe(ts); ts.assertEmpty(); ts.request(1) .assertValuesOnly(1) .request(1) .assertResult(1, 2); }
@Override public void subscribe(Flow.Subscriber<? super R> subscriber) { Objects.requireNonNull(subscriber, "subscriber is null"); source.subscribe(new FlatMapSubscriber<>(subscriber, mapper, maxConcurrency, prefetch, delayErrors)); }
MultiFlatMapPublisher implements Multi<R> { @Override public void subscribe(Flow.Subscriber<? super R> subscriber) { Objects.requireNonNull(subscriber, "subscriber is null"); source.subscribe(new FlatMapSubscriber<>(subscriber, mapper, maxConcurrency, prefetch, delayErrors)); } }
MultiFlatMapPublisher implements Multi<R> { @Override public void subscribe(Flow.Subscriber<? super R> subscriber) { Objects.requireNonNull(subscriber, "subscriber is null"); source.subscribe(new FlatMapSubscriber<>(subscriber, mapper, maxConcurrency, prefetch, delayErrors)); } MultiFlatMapPublisher(Multi<T> source,
                          Function<? super T, ? extends Flow.Publisher<? extends R>> mapper,
                          long maxConcurrency, long prefetch, boolean delayErrors); }
MultiFlatMapPublisher implements Multi<R> { @Override public void subscribe(Flow.Subscriber<? super R> subscriber) { Objects.requireNonNull(subscriber, "subscriber is null"); source.subscribe(new FlatMapSubscriber<>(subscriber, mapper, maxConcurrency, prefetch, delayErrors)); } MultiFlatMapPublisher(Multi<T> source,
                          Function<? super T, ? extends Flow.Publisher<? extends R>> mapper,
                          long maxConcurrency, long prefetch, boolean delayErrors); @Override void subscribe(Flow.Subscriber<? super R> subscriber); }
MultiFlatMapPublisher implements Multi<R> { @Override public void subscribe(Flow.Subscriber<? super R> subscriber) { Objects.requireNonNull(subscriber, "subscriber is null"); source.subscribe(new FlatMapSubscriber<>(subscriber, mapper, maxConcurrency, prefetch, delayErrors)); } MultiFlatMapPublisher(Multi<T> source,
                          Function<? super T, ? extends Flow.Publisher<? extends R>> mapper,
                          long maxConcurrency, long prefetch, boolean delayErrors); @Override void subscribe(Flow.Subscriber<? super R> subscriber);  }