chom :
I am new to RxJava and Spring webflux. Is there a way to convert RxJava Single to Mono?
I want to return a Mono<String>
from the following function.
private Single<String> toNotification(PU update, Tx<PP> tx) {
return findChannels(update.partyId(), update.notificationId(), tx)
.toList()
.flatMap(f -> Single.just("test"));
}
findChannels
returns flowable
Sukhpal Singh :
You can use reactor.adapter.rxjava.RxJava2Adapter.singleToMono(io.reactivex.Single<T> source)
which returns Mono<T>
.
Source: RxJava2Adapter