@Test public void testDebounceNeverEmits() { Observable<String> source = Observable.create(new Observable.OnSubscribeFunc<String>() { @Override public Subscription onSubscribe(Observer<? super String> observer) { publishNext(observer, 100, "a"); publishNext(observer, 200, "b"); publishNext(observer, 300, "c"); publishNext(observer, 400, "d"); publishNext(observer, 500, "e"); publishNext(observer, 600, "f"); publishNext(observer, 700, "g"); publishNext(observer, 800, "h"); publishCompleted(observer, 900); return Subscriptions.empty(); } }); Observable<String> sampled = Observable.create(OperationDebounce.debounce(source, 200, TimeUnit.MILLISECONDS, scheduler)); sampled.subscribe(observer); scheduler.advanceTimeTo(0, TimeUnit.MILLISECONDS); InOrder inOrder = inOrder(observer); inOrder.verify(observer, times(0)).onNext(anyString()); scheduler.advanceTimeTo(1000, TimeUnit.MILLISECONDS); inOrder.verify(observer, times(1)).onCompleted(); 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);  }