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

x33g5p2x  于2022-01-19 转载在 其他  
字(6.6k)|赞(0)|评价(0)|浏览(207)

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

Flowable.skipUntil介绍

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

Backpressure: The operator doesn't interfere with backpressure which is determined by the source Publisher's backpressure behavior. Scheduler: skipUntil does not operate by default on a particular Scheduler.
[中]返回一个可流动项,该可流动项跳过源发布服务器发出的项,直到第二个发布服务器发出项为止。
背压:操作员不会干扰由源发布者的背压行为确定的背压。调度程序:默认情况下,skipUntil不会在特定调度程序上运行。

代码示例

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

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

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

  1. @Override
  2. public Flowable<Object> apply(Flowable<Object> f) throws Exception {
  3. return f.skipUntil(Flowable.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 Publisher<Integer> createPublisher(long elements) {
  3. return
  4. Flowable.range(0, (int)elements).skipUntil(Flowable.just(1))
  5. ;
  6. }
  7. }

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

  1. /**
  2. * Returns a Flowable that skips values emitted by the source Publisher 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>Backpressure:</b></dt>
  8. * <dd>The operator doesn't support backpressure as it uses time to skip an arbitrary number of elements and
  9. * thus has to consume the source {@code Publisher} in an unbounded manner (i.e., no backpressure applied to it).</dd>
  10. * <dt><b>Scheduler:</b></dt>
  11. * <dd>{@code skip} does not operate on any particular scheduler but uses the current time
  12. * from the {@code computation} {@link Scheduler}.</dd>
  13. * </dl>
  14. *
  15. * @param time
  16. * the length of the time window to skip
  17. * @param unit
  18. * the time unit of {@code time}
  19. * @return a Flowable that skips values emitted by the source Publisher before the time window defined
  20. * by {@code time} elapses and the emits the remainder
  21. * @see <a href="http://reactivex.io/documentation/operators/skip.html">ReactiveX operators documentation: Skip</a>
  22. */
  23. @CheckReturnValue
  24. @BackpressureSupport(BackpressureKind.FULL)
  25. @SchedulerSupport(SchedulerSupport.NONE)
  26. public final Flowable<T> skip(long time, TimeUnit unit) {
  27. return skipUntil(timer(time, unit));
  28. }

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

  1. /**
  2. * Returns a Flowable that skips values emitted by the source Publisher 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>Backpressure:</b></dt>
  8. * <dd>The operator doesn't support backpressure as it uses time to skip an arbitrary number of elements and
  9. * thus has to consume the source {@code Publisher} in an unbounded manner (i.e., no backpressure applied to it).</dd>
  10. * <dt><b>Scheduler:</b></dt>
  11. * <dd>You specify which {@link Scheduler} this operator will use for the timed skipping</dd>
  12. * </dl>
  13. *
  14. * @param time
  15. * the length of the time window to skip
  16. * @param unit
  17. * the time unit of {@code time}
  18. * @param scheduler
  19. * the {@link Scheduler} on which the timed wait happens
  20. * @return a Flowable that skips values emitted by the source Publisher before the time window defined
  21. * by {@code time} and {@code scheduler} elapses, and then emits the remainder
  22. * @see <a href="http://reactivex.io/documentation/operators/skip.html">ReactiveX operators documentation: Skip</a>
  23. */
  24. @CheckReturnValue
  25. @BackpressureSupport(BackpressureKind.FULL)
  26. @SchedulerSupport(SchedulerSupport.CUSTOM)
  27. public final Flowable<T> skip(long time, TimeUnit unit, Scheduler scheduler) {
  28. return skipUntil(timer(time, unit, scheduler));
  29. }

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

  1. /**
  2. * Returns a Flowable that skips values emitted by the source Publisher 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>Backpressure:</b></dt>
  8. * <dd>The operator doesn't support backpressure as it uses time to skip an arbitrary number of elements and
  9. * thus has to consume the source {@code Publisher} in an unbounded manner (i.e., no backpressure applied to it).</dd>
  10. * <dt><b>Scheduler:</b></dt>
  11. * <dd>{@code skip} does not operate on any particular scheduler but uses the current time
  12. * from the {@code computation} {@link Scheduler}.</dd>
  13. * </dl>
  14. *
  15. * @param time
  16. * the length of the time window to skip
  17. * @param unit
  18. * the time unit of {@code time}
  19. * @return a Flowable that skips values emitted by the source Publisher before the time window defined
  20. * by {@code time} elapses and the emits the remainder
  21. * @see <a href="http://reactivex.io/documentation/operators/skip.html">ReactiveX operators documentation: Skip</a>
  22. */
  23. @CheckReturnValue
  24. @BackpressureSupport(BackpressureKind.FULL)
  25. @SchedulerSupport(SchedulerSupport.NONE)
  26. public final Flowable<T> skip(long time, TimeUnit unit) {
  27. return skipUntil(timer(time, unit));
  28. }

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

  1. /**
  2. * Returns a Flowable that skips values emitted by the source Publisher 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>Backpressure:</b></dt>
  8. * <dd>The operator doesn't support backpressure as it uses time to skip an arbitrary number of elements and
  9. * thus has to consume the source {@code Publisher} in an unbounded manner (i.e., no backpressure applied to it).</dd>
  10. * <dt><b>Scheduler:</b></dt>
  11. * <dd>You specify which {@link Scheduler} this operator will use for the timed skipping</dd>
  12. * </dl>
  13. *
  14. * @param time
  15. * the length of the time window to skip
  16. * @param unit
  17. * the time unit of {@code time}
  18. * @param scheduler
  19. * the {@link Scheduler} on which the timed wait happens
  20. * @return a Flowable that skips values emitted by the source Publisher before the time window defined
  21. * by {@code time} and {@code scheduler} elapses, and then emits the remainder
  22. * @see <a href="http://reactivex.io/documentation/operators/skip.html">ReactiveX operators documentation: Skip</a>
  23. */
  24. @CheckReturnValue
  25. @BackpressureSupport(BackpressureKind.FULL)
  26. @SchedulerSupport(SchedulerSupport.CUSTOM)
  27. public final Flowable<T> skip(long time, TimeUnit unit, Scheduler scheduler) {
  28. return skipUntil(timer(time, unit, scheduler));
  29. }

相关文章

Flowable类方法