io.reactivex.Observable.skipUntil()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(5.2k)|赞(0)|评价(0)|浏览(165)

本文整理了Java中io.reactivex.Observable.skipUntil()方法的一些代码示例,展示了Observable.skipUntil()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Observable.skipUntil()方法的具体详情如下:
包路径:io.reactivex.Observable
类名称:Observable
方法名:skipUntil

Observable.skipUntil介绍

[英]Returns an Observable that skips items emitted by the source ObservableSource until a second ObservableSource emits an item.

Scheduler: skipUntil does not operate by default on a particular Scheduler.
[中]

代码示例

代码示例来源:origin: ReactiveX/RxJava

  1. @Override
  2. public ObservableSource<Object> apply(Observable<Object> o) throws Exception {
  3. return o.skipUntil(Observable.never());
  4. }
  5. });

代码示例来源:origin: ReactiveX/RxJava

  1. @Test(expected = NullPointerException.class)
  2. public void skipUntilNull() {
  3. just1.skipUntil(null);
  4. }

代码示例来源:origin: ReactiveX/RxJava

  1. @Override
  2. public ObservableSource<Object> apply(Observable<Object> o) throws Exception {
  3. return Observable.never().skipUntil(o);
  4. }
  5. });

代码示例来源:origin: ReactiveX/RxJava

  1. /**
  2. * Returns an Observable that skips values emitted by the source ObservableSource before a specified time window
  3. * on a specified {@link Scheduler} elapses.
  4. * <p>
  5. * <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/skip.ts.png" alt="">
  6. * <dl>
  7. * <dt><b>Scheduler:</b></dt>
  8. * <dd>You specify which {@link Scheduler} this operator will use for the timed skipping</dd>
  9. * </dl>
  10. *
  11. * @param time
  12. * the length of the time window to skip
  13. * @param unit
  14. * the time unit of {@code time}
  15. * @param scheduler
  16. * the {@link Scheduler} on which the timed wait happens
  17. * @return an Observable that skips values emitted by the source ObservableSource before the time window defined
  18. * by {@code time} and {@code scheduler} elapses, and then emits the remainder
  19. * @see <a href="http://reactivex.io/documentation/operators/skip.html">ReactiveX operators documentation: Skip</a>
  20. */
  21. @CheckReturnValue
  22. @SchedulerSupport(SchedulerSupport.CUSTOM)
  23. public final Observable<T> skip(long time, TimeUnit unit, Scheduler scheduler) {
  24. return skipUntil(timer(time, unit, scheduler));
  25. }

代码示例来源:origin: ReactiveX/RxJava

  1. /**
  2. * Returns an Observable that skips values emitted by the source ObservableSource before a specified time window
  3. * elapses.
  4. * <p>
  5. * <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/skip.t.png" alt="">
  6. * <dl>
  7. * <dt><b>Scheduler:</b></dt>
  8. * <dd>{@code skip} does not operate on any particular scheduler but uses the current time
  9. * from the {@code computation} {@link Scheduler}.</dd>
  10. * </dl>
  11. *
  12. * @param time
  13. * the length of the time window to skip
  14. * @param unit
  15. * the time unit of {@code time}
  16. * @return an Observable that skips values emitted by the source ObservableSource before the time window defined
  17. * by {@code time} elapses and the emits the remainder
  18. * @see <a href="http://reactivex.io/documentation/operators/skip.html">ReactiveX operators documentation: Skip</a>
  19. */
  20. @CheckReturnValue
  21. @SchedulerSupport(SchedulerSupport.COMPUTATION)
  22. public final Observable<T> skip(long time, TimeUnit unit) {
  23. return skipUntil(timer(time, unit));
  24. }

代码示例来源:origin: redisson/redisson

  1. /**
  2. * Returns an Observable that skips values emitted by the source ObservableSource before a specified time window
  3. * on a specified {@link Scheduler} elapses.
  4. * <p>
  5. * <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/skip.ts.png" alt="">
  6. * <dl>
  7. * <dt><b>Scheduler:</b></dt>
  8. * <dd>You specify which {@link Scheduler} this operator will use for the timed skipping</dd>
  9. * </dl>
  10. *
  11. * @param time
  12. * the length of the time window to skip
  13. * @param unit
  14. * the time unit of {@code time}
  15. * @param scheduler
  16. * the {@link Scheduler} on which the timed wait happens
  17. * @return an Observable that skips values emitted by the source ObservableSource before the time window defined
  18. * by {@code time} and {@code scheduler} elapses, and then emits the remainder
  19. * @see <a href="http://reactivex.io/documentation/operators/skip.html">ReactiveX operators documentation: Skip</a>
  20. */
  21. @CheckReturnValue
  22. @SchedulerSupport(SchedulerSupport.CUSTOM)
  23. public final Observable<T> skip(long time, TimeUnit unit, Scheduler scheduler) {
  24. return skipUntil(timer(time, unit, scheduler));
  25. }

代码示例来源:origin: redisson/redisson

  1. /**
  2. * Returns an Observable that skips values emitted by the source ObservableSource before a specified time window
  3. * elapses.
  4. * <p>
  5. * <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/skip.t.png" alt="">
  6. * <dl>
  7. * <dt><b>Scheduler:</b></dt>
  8. * <dd>{@code skip} does not operate on any particular scheduler but uses the current time
  9. * from the {@code computation} {@link Scheduler}.</dd>
  10. * </dl>
  11. *
  12. * @param time
  13. * the length of the time window to skip
  14. * @param unit
  15. * the time unit of {@code time}
  16. * @return an Observable that skips values emitted by the source ObservableSource before the time window defined
  17. * by {@code time} elapses and the emits the remainder
  18. * @see <a href="http://reactivex.io/documentation/operators/skip.html">ReactiveX operators documentation: Skip</a>
  19. */
  20. @CheckReturnValue
  21. @SchedulerSupport(SchedulerSupport.COMPUTATION)
  22. public final Observable<T> skip(long time, TimeUnit unit) {
  23. return skipUntil(timer(time, unit));
  24. }

相关文章

Observable类方法