@Test public void millionSources() { @SuppressWarnings("unchecked") Multi<Integer>[] sources = new Multi[1_000_000]; Arrays.fill(sources, Multi.singleton(1)); TestSubscriber<Object> ts = new TestSubscriber<>(Long.MAX_VALUE); Multi.concatArray(sources) .subscribe(ts); ts.assertItemCount(1_000_000) .assertComplete(); }
@Override public void subscribe(Flow.Subscriber<? super T> subscriber) { ConcatArraySubscriber<T> parent = new ConcatArraySubscriber<>(subscriber, sources); subscriber.onSubscribe(parent); parent.nextSource(); }
MultiConcatArray implements Multi<T> { @Override public void subscribe(Flow.Subscriber<? super T> subscriber) { ConcatArraySubscriber<T> parent = new ConcatArraySubscriber<>(subscriber, sources); subscriber.onSubscribe(parent); parent.nextSource(); } }
MultiConcatArray implements Multi<T> { @Override public void subscribe(Flow.Subscriber<? super T> subscriber) { ConcatArraySubscriber<T> parent = new ConcatArraySubscriber<>(subscriber, sources); subscriber.onSubscribe(parent); parent.nextSource(); } MultiConcatArray(Flow.Publisher<T>[] sources); }
MultiConcatArray implements Multi<T> { @Override public void subscribe(Flow.Subscriber<? super T> subscriber) { ConcatArraySubscriber<T> parent = new ConcatArraySubscriber<>(subscriber, sources); subscriber.onSubscribe(parent); parent.nextSource(); } MultiConcatArray(Flow.Publisher<T>[] sources); @Override void subscribe(Flow.Subscriber<? super T> subscriber); }
MultiConcatArray implements Multi<T> { @Override public void subscribe(Flow.Subscriber<? super T> subscriber) { ConcatArraySubscriber<T> parent = new ConcatArraySubscriber<>(subscriber, sources); subscriber.onSubscribe(parent); parent.nextSource(); } MultiConcatArray(Flow.Publisher<T>[] sources); @Override void subscribe(Flow.Subscriber<? super T> subscriber);  }