@Test public void mainEmpty() { TestSubscriber<Long> ts = new TestSubscriber<>(Long.MAX_VALUE); Single.<Long>empty() .timeout(1, TimeUnit.MINUTES, executor) .subscribe(ts); ts.assertResult(); }
@Override public void subscribe(Flow.Subscriber<? super T> subscriber) { TimeoutSubscriber<T> parent = new TimeoutSubscriber<>(subscriber, fallback); subscriber.onSubscribe(parent); parent.setFuture(executor.schedule(parent, timeout, unit)); source.subscribe(parent); }
SingleTimeout extends CompletionSingle<T> { @Override public void subscribe(Flow.Subscriber<? super T> subscriber) { TimeoutSubscriber<T> parent = new TimeoutSubscriber<>(subscriber, fallback); subscriber.onSubscribe(parent); parent.setFuture(executor.schedule(parent, timeout, unit)); source.subscribe(parent); } }
SingleTimeout extends CompletionSingle<T> { @Override public void subscribe(Flow.Subscriber<? super T> subscriber) { TimeoutSubscriber<T> parent = new TimeoutSubscriber<>(subscriber, fallback); subscriber.onSubscribe(parent); parent.setFuture(executor.schedule(parent, timeout, unit)); source.subscribe(parent); } SingleTimeout(Single<T> source, long timeout, TimeUnit unit,
                  ScheduledExecutorService executor, Single<T> fallback); }
SingleTimeout extends CompletionSingle<T> { @Override public void subscribe(Flow.Subscriber<? super T> subscriber) { TimeoutSubscriber<T> parent = new TimeoutSubscriber<>(subscriber, fallback); subscriber.onSubscribe(parent); parent.setFuture(executor.schedule(parent, timeout, unit)); source.subscribe(parent); } SingleTimeout(Single<T> source, long timeout, TimeUnit unit,
                  ScheduledExecutorService executor, Single<T> fallback); @Override void subscribe(Flow.Subscriber<? super T> subscriber); }
SingleTimeout extends CompletionSingle<T> { @Override public void subscribe(Flow.Subscriber<? super T> subscriber) { TimeoutSubscriber<T> parent = new TimeoutSubscriber<>(subscriber, fallback); subscriber.onSubscribe(parent); parent.setFuture(executor.schedule(parent, timeout, unit)); source.subscribe(parent); } SingleTimeout(Single<T> source, long timeout, TimeUnit unit,
                  ScheduledExecutorService executor, Single<T> fallback); @Override void subscribe(Flow.Subscriber<? super T> subscriber);  }