本文整理了Java中reactor.core.publisher.Flux.onBackpressureError()
方法的一些代码示例,展示了Flux.onBackpressureError()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Flux.onBackpressureError()
方法的具体详情如下:
包路径:reactor.core.publisher.Flux
类名称:Flux
方法名:onBackpressureError
[英]Request an unbounded demand and push to the returned Flux, or emit onError fom Exceptions#failWithOverflow if not enough demand is requested downstream.
[中]请求一个无限制的需求并推送到返回的流量,或者如果下游请求的需求不足,则发出一个错误的fom异常#failWithOverflow。
代码示例来源:origin: reactor/reactor-core
@Test
public void normalError() {
AssertSubscriber<Integer> ts = AssertSubscriber.create();
Flux.range(1, 10)
.onBackpressureError()
.subscribe(ts);
ts.assertValues(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
.assertNoError()
.assertComplete();
}
代码示例来源:origin: com.aol.cyclops/cyclops-reactor
/**
* @return
* @see reactor.core.publisher.Flux#onBackpressureError()
*/
public final Flux<T> onBackpressureError() {
return boxed.onBackpressureError();
}
/**
代码示例来源:origin: io.projectreactor/reactor-netty
@Override
default ByteBufEncodedFlux receive() {
return ByteBufEncodedFlux.encoded(receiveParts().onBackpressureError()
.concatMap(parts -> parts.aggregate()
.retain())
.flatMap(bb ->
Flux.using(() -> bb,
Flux::just,
ReferenceCounted::release)),
delegate().alloc());
}
代码示例来源:origin: akarnokd/akarnokd-misc
onBackpressureError().
subscribeOn(Schedulers.newSingle("production")).
publishOn(Schedulers.elastic()).
代码示例来源:origin: akarnokd/akarnokd-misc
@Test
public void fluxCreateDemoElasticScheduler2() throws Exception {
final int inputCount = 1000;
TestSubscriber<Integer> ts = new TestSubscriber<>(0L);
Flux.<Integer>create(
sink -> {
for (int i = 0; i < inputCount; i++) {
//logger.info("Injecting {}", i);
sink.next(i);
}
sink.complete();
}).
onBackpressureError().subscribe(ts);
ts.assertNoValues()
.assertError(IllegalStateException.class)
.assertNotComplete();
}
内容来源于网络,如有侵权,请联系作者删除!