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

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

本文整理了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

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

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

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

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

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

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

@Override
  public Publisher<Integer> createPublisher(long elements) {
    return
        Flowable.range(0, (int)elements).skipUntil(Flowable.just(1))
    ;
  }
}

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

/**
 * Returns a Flowable that skips values emitted by the source Publisher before a specified time window
 * elapses.
 * <p>
 * <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/skip.t.png" alt="">
 * <dl>
 *  <dt><b>Backpressure:</b></dt>
 *  <dd>The operator doesn't support backpressure as it uses time to skip an arbitrary number of elements and
 *  thus has to consume the source {@code Publisher} in an unbounded manner (i.e., no backpressure applied to it).</dd>
 *  <dt><b>Scheduler:</b></dt>
 *  <dd>{@code skip} does not operate on any particular scheduler but uses the current time
 *  from the {@code computation} {@link Scheduler}.</dd>
 * </dl>
 *
 * @param time
 *            the length of the time window to skip
 * @param unit
 *            the time unit of {@code time}
 * @return a Flowable that skips values emitted by the source Publisher before the time window defined
 *         by {@code time} elapses and the emits the remainder
 * @see <a href="http://reactivex.io/documentation/operators/skip.html">ReactiveX operators documentation: Skip</a>
 */
@CheckReturnValue
@BackpressureSupport(BackpressureKind.FULL)
@SchedulerSupport(SchedulerSupport.NONE)
public final Flowable<T> skip(long time, TimeUnit unit) {
  return skipUntil(timer(time, unit));
}

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

/**
 * Returns a Flowable that skips values emitted by the source Publisher before a specified time window
 * on a specified {@link Scheduler} elapses.
 * <p>
 * <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/skip.ts.png" alt="">
 * <dl>
 *  <dt><b>Backpressure:</b></dt>
 *  <dd>The operator doesn't support backpressure as it uses time to skip an arbitrary number of elements and
 *  thus has to consume the source {@code Publisher} in an unbounded manner (i.e., no backpressure applied to it).</dd>
 *  <dt><b>Scheduler:</b></dt>
 *  <dd>You specify which {@link Scheduler} this operator will use for the timed skipping</dd>
 * </dl>
 *
 * @param time
 *            the length of the time window to skip
 * @param unit
 *            the time unit of {@code time}
 * @param scheduler
 *            the {@link Scheduler} on which the timed wait happens
 * @return a Flowable that skips values emitted by the source Publisher before the time window defined
 *         by {@code time} and {@code scheduler} elapses, and then emits the remainder
 * @see <a href="http://reactivex.io/documentation/operators/skip.html">ReactiveX operators documentation: Skip</a>
 */
@CheckReturnValue
@BackpressureSupport(BackpressureKind.FULL)
@SchedulerSupport(SchedulerSupport.CUSTOM)
public final Flowable<T> skip(long time, TimeUnit unit, Scheduler scheduler) {
  return skipUntil(timer(time, unit, scheduler));
}

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

/**
 * Returns a Flowable that skips values emitted by the source Publisher before a specified time window
 * elapses.
 * <p>
 * <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/skip.t.png" alt="">
 * <dl>
 *  <dt><b>Backpressure:</b></dt>
 *  <dd>The operator doesn't support backpressure as it uses time to skip an arbitrary number of elements and
 *  thus has to consume the source {@code Publisher} in an unbounded manner (i.e., no backpressure applied to it).</dd>
 *  <dt><b>Scheduler:</b></dt>
 *  <dd>{@code skip} does not operate on any particular scheduler but uses the current time
 *  from the {@code computation} {@link Scheduler}.</dd>
 * </dl>
 *
 * @param time
 *            the length of the time window to skip
 * @param unit
 *            the time unit of {@code time}
 * @return a Flowable that skips values emitted by the source Publisher before the time window defined
 *         by {@code time} elapses and the emits the remainder
 * @see <a href="http://reactivex.io/documentation/operators/skip.html">ReactiveX operators documentation: Skip</a>
 */
@CheckReturnValue
@BackpressureSupport(BackpressureKind.FULL)
@SchedulerSupport(SchedulerSupport.NONE)
public final Flowable<T> skip(long time, TimeUnit unit) {
  return skipUntil(timer(time, unit));
}

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

/**
 * Returns a Flowable that skips values emitted by the source Publisher before a specified time window
 * on a specified {@link Scheduler} elapses.
 * <p>
 * <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/skip.ts.png" alt="">
 * <dl>
 *  <dt><b>Backpressure:</b></dt>
 *  <dd>The operator doesn't support backpressure as it uses time to skip an arbitrary number of elements and
 *  thus has to consume the source {@code Publisher} in an unbounded manner (i.e., no backpressure applied to it).</dd>
 *  <dt><b>Scheduler:</b></dt>
 *  <dd>You specify which {@link Scheduler} this operator will use for the timed skipping</dd>
 * </dl>
 *
 * @param time
 *            the length of the time window to skip
 * @param unit
 *            the time unit of {@code time}
 * @param scheduler
 *            the {@link Scheduler} on which the timed wait happens
 * @return a Flowable that skips values emitted by the source Publisher before the time window defined
 *         by {@code time} and {@code scheduler} elapses, and then emits the remainder
 * @see <a href="http://reactivex.io/documentation/operators/skip.html">ReactiveX operators documentation: Skip</a>
 */
@CheckReturnValue
@BackpressureSupport(BackpressureKind.FULL)
@SchedulerSupport(SchedulerSupport.CUSTOM)
public final Flowable<T> skip(long time, TimeUnit unit, Scheduler scheduler) {
  return skipUntil(timer(time, unit, scheduler));
}

相关文章

Flowable类方法