本文整理了Java中io.reactivex.Flowable.concatMapMaybeDelayError()
方法的一些代码示例,展示了Flowable.concatMapMaybeDelayError()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Flowable.concatMapMaybeDelayError()
方法的具体详情如下:
包路径:io.reactivex.Flowable
类名称:Flowable
方法名:concatMapMaybeDelayError
[英]Maps the upstream items into MaybeSources and subscribes to them one after the other terminates, emits their success value if available and delaying all errors till both this Flowable and all inner MaybeSources terminate.
Backpressure: The operator expects the upstream to support backpressure and honors the backpressure from downstream. If this Flowable violates the rule, the operator will signal a MissingBackpressureException. Scheduler: concatMapMaybeDelayError does not operate by default on a particular Scheduler.
[中]将上游项目映射到MaybeSources中,并在另一个终止后一个接一个地订阅它们,如果可用,则发出它们的成功值,并延迟所有错误,直到此可流动和所有内部MaybeSources终止。
背压:操作员希望上游支持背压,并尊重下游的背压。如果该流体违反规则,操作员将发出缺少背压异常的信号。调度程序:默认情况下,concatMapMaybeDelayError不会在特定调度程序上运行。
代码示例来源:origin: ReactiveX/RxJava
/**
* Maps the upstream items into {@link MaybeSource}s and subscribes to them one after the
* other terminates, emits their success value if available and delaying all errors
* till both this {@code Flowable} and all inner {@code MaybeSource}s terminate.
* <p>
* <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/concatMap.png" alt="">
* <dl>
* <dt><b>Backpressure:</b></dt>
* <dd>The operator expects the upstream to support backpressure and honors
* the backpressure from downstream. If this {@code Flowable} violates the rule, the operator will
* signal a {@code MissingBackpressureException}.</dd>
* <dt><b>Scheduler:</b></dt>
* <dd>{@code concatMapMaybeDelayError} does not operate by default on a particular {@link Scheduler}.</dd>
* </dl>
* <p>History: 2.1.11 - experimental
* @param <R> the result type of the inner {@code MaybeSource}s
* @param mapper the function called with the upstream item and should return
* a {@code MaybeSource} to become the next source to
* be subscribed to
* @return a new Flowable instance
* @see #concatMapMaybe(Function)
* @see #concatMapMaybeDelayError(Function, boolean)
* @since 2.2
*/
@CheckReturnValue
@BackpressureSupport(BackpressureKind.FULL)
@SchedulerSupport(SchedulerSupport.NONE)
public final <R> Flowable<R> concatMapMaybeDelayError(Function<? super T, ? extends MaybeSource<? extends R>> mapper) {
return concatMapMaybeDelayError(mapper, true, 2);
}
代码示例来源:origin: ReactiveX/RxJava
@Override
public Flowable<Object> apply(Flowable<Object> f)
throws Exception {
return f.concatMapMaybeDelayError(
Functions.justFunction(Maybe.empty()));
}
}
代码示例来源:origin: ReactiveX/RxJava
@SchedulerSupport(SchedulerSupport.NONE)
public final <R> Flowable<R> concatMapMaybeDelayError(Function<? super T, ? extends MaybeSource<? extends R>> mapper, boolean tillTheEnd) {
return concatMapMaybeDelayError(mapper, tillTheEnd, 2);
代码示例来源:origin: redisson/redisson
/**
* Maps the upstream items into {@link MaybeSource}s and subscribes to them one after the
* other terminates, emits their success value if available and delaying all errors
* till both this {@code Flowable} and all inner {@code MaybeSource}s terminate.
* <p>
* <img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/concatMap.png" alt="">
* <dl>
* <dt><b>Backpressure:</b></dt>
* <dd>The operator expects the upstream to support backpressure and honors
* the backpressure from downstream. If this {@code Flowable} violates the rule, the operator will
* signal a {@code MissingBackpressureException}.</dd>
* <dt><b>Scheduler:</b></dt>
* <dd>{@code concatMapMaybeDelayError} does not operate by default on a particular {@link Scheduler}.</dd>
* </dl>
* @param <R> the result type of the inner {@code MaybeSource}s
* @param mapper the function called with the upstream item and should return
* a {@code MaybeSource} to become the next source to
* be subscribed to
* @return a new Flowable instance
* @since 2.1.11 - experimental
* @see #concatMapMaybe(Function)
* @see #concatMapMaybeDelayError(Function, boolean)
*/
@CheckReturnValue
@BackpressureSupport(BackpressureKind.FULL)
@SchedulerSupport(SchedulerSupport.NONE)
@Experimental
public final <R> Flowable<R> concatMapMaybeDelayError(Function<? super T, ? extends MaybeSource<? extends R>> mapper) {
return concatMapMaybeDelayError(mapper, true, 2);
}
代码示例来源:origin: redisson/redisson
@Experimental
public final <R> Flowable<R> concatMapMaybeDelayError(Function<? super T, ? extends MaybeSource<? extends R>> mapper, boolean tillTheEnd) {
return concatMapMaybeDelayError(mapper, tillTheEnd, 2);
代码示例来源:origin: ReactiveX/RxJava
@Test
public void delayAllErrors() {
Flowable.range(1, 5)
.concatMapMaybeDelayError(new Function<Integer, MaybeSource<? extends Object>>() {
@Override
public MaybeSource<? extends Object> apply(Integer v)
throws Exception {
return Maybe.error(new TestException());
}
})
.test()
.assertFailure(CompositeException.class)
.assertOf(new Consumer<TestSubscriber<Object>>() {
@Override
public void accept(TestSubscriber<Object> ts) throws Exception {
CompositeException ce = (CompositeException)ts.errors().get(0);
assertEquals(5, ce.getExceptions().size());
}
});
}
内容来源于网络,如有侵权,请联系作者删除!