本文整理了Java中reactor.core.publisher.Mono.dematerialize()
方法的一些代码示例,展示了Mono.dematerialize()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Mono.dematerialize()
方法的具体详情如下:
包路径:reactor.core.publisher.Mono
类名称:Mono
方法名:dematerialize
[英]An operator working only if this Mono emits onNext, onError or onComplete Signalinstances, transforming these #materialize() signals into real signals on the Subscriber. The error Signal will trigger onError and complete Signal will trigger onComplete.
[中]仅当该单声道发出onNext、onError或onComplete信号实例时,操作员才工作,将这些#materialize()信号转换为用户上的真实信号。错误信号将触发onError,完成信号将触发onComplete。
代码示例来源:origin: reactor/reactor-core
@Test
public void singleError() {
AssertSubscriber<Integer> ts = AssertSubscriber.create();
Mono<Integer> dematerialize = Mono.just(error)
.dematerialize();
dematerialize.subscribe(ts);
ts.assertNoValues()
.assertError(RuntimeException.class)
.assertNotComplete();
}
代码示例来源:origin: reactor/reactor-core
@Test
public void errorAfterSingleSignal() {
AssertSubscriber<Integer> ts = AssertSubscriber.create(0);
Mono<Integer> dematerialize = Mono.just(error)
.dematerialize();
dematerialize.subscribe(ts);
ts.assertNoValues()
.assertError(RuntimeException.class)
.assertNotComplete();
}
代码示例来源:origin: reactor/reactor-core
@Test
public void immediateError() {
AssertSubscriber<Integer> ts = AssertSubscriber.create(0);
Mono<Integer> dematerialize = Mono.just(error)
.dematerialize();
dematerialize.subscribe(ts);
ts.assertNoValues()
.assertError(RuntimeException.class)
.assertNotComplete();
}
代码示例来源:origin: reactor/reactor-core
@Test
public void immediateCompletion() {
AssertSubscriber<Integer> ts = AssertSubscriber.create(0);
Mono<Integer> dematerialize = Mono.just(Signal.<Integer>complete())
.dematerialize();
dematerialize.subscribe(ts);
ts.assertNoValues()
.assertNoError()
.assertComplete();
}
代码示例来源:origin: reactor/reactor-core
@Test
public void singleCompletion() {
AssertSubscriber<Integer> ts = AssertSubscriber.create();
Mono<Integer> dematerialize = Mono.just(Signal.<Integer>complete())
.dematerialize();
dematerialize.subscribe(ts);
ts.assertNoValues()
.assertNoError()
.assertComplete();
}
代码示例来源:origin: reactor/reactor-core
@Test
public void completeAfterSingleSignal() {
AssertSubscriber<Integer> ts = AssertSubscriber.create(0);
Mono<Integer> dematerialize = Mono.just(Signal.next(1))
.dematerialize();
dematerialize.subscribe(ts);
ts.assertNoValues()
.assertNoError()
.assertNotComplete();
ts.request(1);
ts.assertValues(1)
.assertNoError()
.assertComplete();
}
代码示例来源:origin: com.aol.cyclops/cyclops-reactor
/**
* @return
* @see reactor.core.publisher.Mono#dematerialize()
*/
public final <X> Mono<X> dematerialize() {
return boxed.dematerialize();
}
/**
代码示例来源:origin: io.projectreactor.addons/reactor-extra
.dematerialize());
代码示例来源:origin: io.projectreactor.addons/reactor-extra
.switchIfEmpty(otherSupplier.get().materialize()
.doOnNext(value -> cacheMap.put(key, value)))
.dematerialize()
);
内容来源于网络,如有侵权,请联系作者删除!