cho*_*hom 4 java rx-java2 spring-webflux
我是 RxJava 和 Spring webflux 的新手。有没有办法将 RxJava Single 转换为 Mono?
我想Mono<String>
从以下函数返回 a 。
private Single<String> toNotification(PU update, Tx<PP> tx) {
return findChannels(update.partyId(), update.notificationId(), tx)
.toList()
.flatMap(f -> Single.just("test"));
}
Run Code Online (Sandbox Code Playgroud)
findChannels
回报可流动
您可以使用reactor.adapter.rxjava.RxJava2Adapter.singleToMono(io.reactivex.Single<T> source)
which 返回Mono<T>
。