@Test public void testDebounceWithError() { Observable<String> source = Observable.create(new Observable.OnSubscribeFunc<String>() { @Override public Subscription onSubscribe(Observer<? super String> observer) { Exception error = new TestException(); publishNext(observer, 100, "one"); publishNext(observer, 600, "two"); publishError(observer, 700, error); return Subscriptions.empty(); } }); Observable<String> sampled = Observable.create(OperationDebounce.debounce(source, 400, TimeUnit.MILLISECONDS, scheduler)); sampled.subscribe(observer); scheduler.advanceTimeTo(0, TimeUnit.MILLISECONDS); InOrder inOrder = inOrder(observer); scheduler.advanceTimeTo(500, TimeUnit.MILLISECONDS); inOrder.verify(observer).onNext("one"); scheduler.advanceTimeTo(701, TimeUnit.MILLISECONDS); inOrder.verify(observer).onError(any(TestException.class)); inOrder.verifyNoMoreInteractions(); }
public static <T> OnSubscribeFunc<T> debounce(Observable<T> items, long timeout, TimeUnit unit) { return debounce(items, timeout, unit, Schedulers.computation()); }
OperationDebounce { public static <T> OnSubscribeFunc<T> debounce(Observable<T> items, long timeout, TimeUnit unit) { return debounce(items, timeout, unit, Schedulers.computation()); } }
OperationDebounce { public static <T> OnSubscribeFunc<T> debounce(Observable<T> items, long timeout, TimeUnit unit) { return debounce(items, timeout, unit, Schedulers.computation()); }  }
OperationDebounce { public static <T> OnSubscribeFunc<T> debounce(Observable<T> items, long timeout, TimeUnit unit) { return debounce(items, timeout, unit, Schedulers.computation()); }  static OnSubscribeFunc<T> debounce(Observable<T> items, long timeout, TimeUnit unit); static OnSubscribeFunc<T> debounce(final Observable<T> items, final long timeout, final TimeUnit unit, final Scheduler scheduler); static OnSubscribeFunc<T> debounceSelector(
            Observable<? extends T> source,
            Func1<? super T, ? extends Observable<U>> debounceSelector); }
OperationDebounce { public static <T> OnSubscribeFunc<T> debounce(Observable<T> items, long timeout, TimeUnit unit) { return debounce(items, timeout, unit, Schedulers.computation()); }  static OnSubscribeFunc<T> debounce(Observable<T> items, long timeout, TimeUnit unit); static OnSubscribeFunc<T> debounce(final Observable<T> items, final long timeout, final TimeUnit unit, final Scheduler scheduler); static OnSubscribeFunc<T> debounceSelector(
            Observable<? extends T> source,
            Func1<? super T, ? extends Observable<U>> debounceSelector);  }