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

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

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

Flowable.concatArrayDelayError介绍

[英]Concatenates a variable number of Publisher sources and delays errors from any of them till all terminate.

Backpressure: The operator honors backpressure from downstream. The Publishersources are expected to honor backpressure as well. If any of the source Publishers violate this, it may throw an IllegalStateException when the source Publisher completes. Scheduler: concatArrayDelayError does not operate by default on a particular Scheduler.
[中]连接数量可变的发布服务器源,并延迟其中任何一个源的错误,直到所有源终止。
背压:操作员接受来自下游的背压。预计出版商资源也将承受背压。如果任何源发布服务器违反此规则,则在源发布服务器完成时,它可能抛出非法状态异常。调度程序:默认情况下,concatArrayDelayError不会在特定调度程序上运行。

代码示例

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

@SuppressWarnings("unchecked")
@Test
public void emptyArray() {
  assertSame(Flowable.empty(), Flowable.concatArrayDelayError());
}

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

@SuppressWarnings("unchecked")
@Test
public void singleElementArray() {
  assertSame(Flowable.never(), Flowable.concatArrayDelayError(Flowable.never()));
}

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

@SuppressWarnings("unchecked")
@Test
public void arrayDelayError() {
  Publisher<Integer>[] sources = new Publisher[] {
      Flowable.just(1),
      null,
      Flowable.range(2, 3),
      Flowable.error(new TestException()),
      Flowable.empty()
  };
  TestSubscriber<Integer> ts = Flowable.concatArrayDelayError(sources).test();
  ts.assertFailure(CompositeException.class, 1, 2, 3, 4);
  CompositeException composite = (CompositeException)ts.errors().get(0);
  List<Throwable> list = composite.getExceptions();
  assertTrue(list.get(0).toString(), list.get(0) instanceof NullPointerException);
  assertTrue(list.get(1).toString(), list.get(1) instanceof TestException);
}

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

@SuppressWarnings("unchecked")
@Test
public void concatArrayDelayError() {
  Flowable.concatArrayDelayError(Flowable.just(1), Flowable.just(2),
      Flowable.just(3), Flowable.just(4))
  .test()
  .assertResult(1, 2, 3, 4);
}

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

@SuppressWarnings("unchecked")
@Test
public void noSubsequentSubscriptionDelayError() {
  final int[] calls = { 0 };
  Flowable<Integer> source = Flowable.create(new FlowableOnSubscribe<Integer>() {
    @Override
    public void subscribe(FlowableEmitter<Integer> s) throws Exception {
      calls[0]++;
      s.onNext(1);
      s.onComplete();
    }
  }, BackpressureStrategy.MISSING);
  Flowable.concatArrayDelayError(source, source).firstElement()
  .test()
  .assertResult(1);
  assertEquals(1, calls[0]);
}

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

@SuppressWarnings("unchecked")
@Test
public void concatArrayDelayErrorWithError() {
  Flowable.concatArrayDelayError(Flowable.just(1), Flowable.just(2),
      Flowable.just(3).concatWith(Flowable.<Integer>error(new TestException())),
      Flowable.just(4))
  .test()
  .assertFailure(TestException.class, 1, 2, 3, 4);
}

代码示例来源:origin: akarnokd/RxJava2Extensions

/**
 * Concatenate the values in order from a sequence of Perhaps sources, delaying
 * errors till all sources terminate.
 * @param <T> the common base value type
 * @param sources the sequence of sources
 * @return the new Flowable instance
 */
public static <T> Flowable<T> concatArrayDelayError(Perhaps<? extends T>... sources) {
  return Flowable.concatArrayDelayError(sources);
}

代码示例来源:origin: akarnokd/RxJava2Extensions

/**
 * Concatenate the values in order from a sequence of Solo sources, delaying
 * errors till all sources terminate.
 * @param <T> the common base value type
 * @param sources the sequence of sources
 * @return the new Flowable instance
 */
public static <T> Flowable<T> concatArrayDelayError(Solo<? extends T>... sources) {
  return Flowable.concatArrayDelayError(sources);
}

代码示例来源:origin: com.github.akarnokd/rxjava2-extensions

/**
 * Concatenate the values in order from a sequence of Solo sources, delaying
 * errors till all sources terminate.
 * @param <T> the common base value type
 * @param sources the sequence of sources
 * @return the new Flowable instance
 */
public static <T> Flowable<T> concatArrayDelayError(Solo<? extends T>... sources) {
  return Flowable.concatArrayDelayError(sources);
}

代码示例来源:origin: com.github.akarnokd/rxjava2-extensions

/**
 * Concatenate the values in order from a sequence of Perhaps sources, delaying
 * errors till all sources terminate.
 * @param <T> the common base value type
 * @param sources the sequence of sources
 * @return the new Flowable instance
 */
public static <T> Flowable<T> concatArrayDelayError(Perhaps<? extends T>... sources) {
  return Flowable.concatArrayDelayError(sources);
}

相关文章

Flowable类方法