@Test public void fallback() { TestSubscriber<Integer> ts = new TestSubscriber<>(Long.MAX_VALUE); Multi.<Integer>never() .timeout(1, TimeUnit.MILLISECONDS, executor, Multi.just(1)) .subscribe(ts); ts.awaitDone(5, TimeUnit.SECONDS) .assertResult(1); }
@Override public void subscribe(Flow.Subscriber<? super T> subscriber) { TimeoutSubscriber<T> parent = new TimeoutSubscriber<>(subscriber, timeout, unit, executor, fallback); subscriber.onSubscribe(parent); parent.schedule(0L); source.subscribe(parent); }
MultiTimeout implements Multi<T> { @Override public void subscribe(Flow.Subscriber<? super T> subscriber) { TimeoutSubscriber<T> parent = new TimeoutSubscriber<>(subscriber, timeout, unit, executor, fallback); subscriber.onSubscribe(parent); parent.schedule(0L); source.subscribe(parent); } }
MultiTimeout implements Multi<T> { @Override public void subscribe(Flow.Subscriber<? super T> subscriber) { TimeoutSubscriber<T> parent = new TimeoutSubscriber<>(subscriber, timeout, unit, executor, fallback); subscriber.onSubscribe(parent); parent.schedule(0L); source.subscribe(parent); } MultiTimeout(Multi<T> source, long timeout, TimeUnit unit,
                 ScheduledExecutorService executor, Flow.Publisher<T> fallback); }
MultiTimeout implements Multi<T> { @Override public void subscribe(Flow.Subscriber<? super T> subscriber) { TimeoutSubscriber<T> parent = new TimeoutSubscriber<>(subscriber, timeout, unit, executor, fallback); subscriber.onSubscribe(parent); parent.schedule(0L); source.subscribe(parent); } MultiTimeout(Multi<T> source, long timeout, TimeUnit unit,
                 ScheduledExecutorService executor, Flow.Publisher<T> fallback); @Override void subscribe(Flow.Subscriber<? super T> subscriber); }
MultiTimeout implements Multi<T> { @Override public void subscribe(Flow.Subscriber<? super T> subscriber) { TimeoutSubscriber<T> parent = new TimeoutSubscriber<>(subscriber, timeout, unit, executor, fallback); subscriber.onSubscribe(parent); parent.schedule(0L); source.subscribe(parent); } MultiTimeout(Multi<T> source, long timeout, TimeUnit unit,
                 ScheduledExecutorService executor, Flow.Publisher<T> fallback); @Override void subscribe(Flow.Subscriber<? super T> subscriber);  }