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

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

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

Flowable.concatMapCompletableDelayError介绍

[英]Maps the upstream items into CompletableSources and subscribes to them one after the other terminates, delaying all errors till both this Flowable and all inner CompletableSources terminate.

Backpressure: The operator expects the upstream to support backpressure. If this Flowable violates the rule, the operator will signal a MissingBackpressureException. Scheduler: concatMapCompletableDelayError does not operate by default on a particular Scheduler.
[中]将上游项映射到CompletableSources中,并在另一个终止后一个接一个地订阅它们,延迟所有错误,直到此可流动源和所有内部CompletableSources终止。
背压:操作员希望上游支持背压。如果该流体违反规则,操作员将发出缺少背压异常的信号。调度程序:默认情况下,concatMapCompletableDelayError不会在特定调度程序上运行。

代码示例

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

  1. /**
  2. * Maps the upstream items into {@link CompletableSource}s and subscribes to them one after the
  3. * other terminates, delaying all errors till both this {@code Flowable} and all
  4. * inner {@code CompletableSource}s terminate.
  5. * <p>
  6. * <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/concatMap.png" alt="">
  7. * <dl>
  8. * <dt><b>Backpressure:</b></dt>
  9. * <dd>The operator expects the upstream to support backpressure. If this {@code Flowable} violates the rule, the operator will
  10. * signal a {@code MissingBackpressureException}.</dd>
  11. * <dt><b>Scheduler:</b></dt>
  12. * <dd>{@code concatMapCompletableDelayError} does not operate by default on a particular {@link Scheduler}.</dd>
  13. * </dl>
  14. * <p>History: 2.1.11 - experimental
  15. * @param mapper the function called with the upstream item and should return
  16. * a {@code CompletableSource} to become the next source to
  17. * be subscribed to
  18. * @return a new Completable instance
  19. * @see #concatMapCompletable(Function, int)
  20. * @since 2.2
  21. */
  22. @CheckReturnValue
  23. @SchedulerSupport(SchedulerSupport.NONE)
  24. @BackpressureSupport(BackpressureKind.FULL)
  25. public final Completable concatMapCompletableDelayError(Function<? super T, ? extends CompletableSource> mapper) {
  26. return concatMapCompletableDelayError(mapper, true, 2);
  27. }

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

  1. @BackpressureSupport(BackpressureKind.FULL)
  2. public final Completable concatMapCompletableDelayError(Function<? super T, ? extends CompletableSource> mapper, boolean tillTheEnd) {
  3. return concatMapCompletableDelayError(mapper, tillTheEnd, 2);

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

  1. /**
  2. * Maps the upstream items into {@link CompletableSource}s and subscribes to them one after the
  3. * other terminates, delaying all errors till both this {@code Flowable} and all
  4. * inner {@code CompletableSource}s terminate.
  5. * <p>
  6. * <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/concatMap.png" alt="">
  7. * <dl>
  8. * <dt><b>Backpressure:</b></dt>
  9. * <dd>The operator expects the upstream to support backpressure. If this {@code Flowable} violates the rule, the operator will
  10. * signal a {@code MissingBackpressureException}.</dd>
  11. * <dt><b>Scheduler:</b></dt>
  12. * <dd>{@code concatMapCompletableDelayError} does not operate by default on a particular {@link Scheduler}.</dd>
  13. * </dl>
  14. * @param mapper the function called with the upstream item and should return
  15. * a {@code CompletableSource} to become the next source to
  16. * be subscribed to
  17. * @return a new Completable instance
  18. * @since 2.1.11 - experimental
  19. * @see #concatMapCompletable(Function, int)
  20. */
  21. @CheckReturnValue
  22. @SchedulerSupport(SchedulerSupport.NONE)
  23. @BackpressureSupport(BackpressureKind.FULL)
  24. @Experimental
  25. public final Completable concatMapCompletableDelayError(Function<? super T, ? extends CompletableSource> mapper) {
  26. return concatMapCompletableDelayError(mapper, true, 2);
  27. }

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

  1. @Experimental
  2. public final Completable concatMapCompletableDelayError(Function<? super T, ? extends CompletableSource> mapper, boolean tillTheEnd) {
  3. return concatMapCompletableDelayError(mapper, tillTheEnd, 2);

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

  1. @Test
  2. public void innerErrorDelayed() {
  3. Flowable.range(1, 5)
  4. .concatMapCompletableDelayError(
  5. new Function<Integer, CompletableSource>() {
  6. @Override
  7. public CompletableSource apply(Integer v) throws Exception {
  8. return Completable.error(new TestException());
  9. }
  10. }
  11. )
  12. .test()
  13. .assertFailure(CompositeException.class)
  14. .assertOf(new Consumer<TestObserver<Void>>() {
  15. @Override
  16. public void accept(TestObserver<Void> to) throws Exception {
  17. assertEquals(5, ((CompositeException)to.errors().get(0)).getExceptions().size());
  18. }
  19. });
  20. }

相关文章

Flowable类方法