@Test public void fallbackBackpressured() { TestSubscriber<Integer> ts = new TestSubscriber<>(); Multi.<Integer>empty() .defaultIfEmpty(2) .subscribe(ts); ts .assertEmpty() .request(1) .assertResult(2); }
@Override public void subscribe(Flow.Subscriber<? super T> subscriber) { source.subscribe(new DefaultIfEmptySubscriber<>(subscriber, defaultItem)); }
MultiDefaultIfEmpty implements Multi<T> { @Override public void subscribe(Flow.Subscriber<? super T> subscriber) { source.subscribe(new DefaultIfEmptySubscriber<>(subscriber, defaultItem)); } }
MultiDefaultIfEmpty implements Multi<T> { @Override public void subscribe(Flow.Subscriber<? super T> subscriber) { source.subscribe(new DefaultIfEmptySubscriber<>(subscriber, defaultItem)); } MultiDefaultIfEmpty(Multi<T> source, T defaultItem); }
MultiDefaultIfEmpty implements Multi<T> { @Override public void subscribe(Flow.Subscriber<? super T> subscriber) { source.subscribe(new DefaultIfEmptySubscriber<>(subscriber, defaultItem)); } MultiDefaultIfEmpty(Multi<T> source, T defaultItem); @Override void subscribe(Flow.Subscriber<? super T> subscriber); }
MultiDefaultIfEmpty implements Multi<T> { @Override public void subscribe(Flow.Subscriber<? super T> subscriber) { source.subscribe(new DefaultIfEmptySubscriber<>(subscriber, defaultItem)); } MultiDefaultIfEmpty(Multi<T> source, T defaultItem); @Override void subscribe(Flow.Subscriber<? super T> subscriber);  }