反应堆通量< MyObject>到Mono< List< MyObject>> [英] Reactor Flux<MyObject> to Mono<List<MyObject>>

查看:133
本文介绍了反应堆通量< MyObject>到Mono< List< MyObject>>的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将Flux<MyObject>直接转换为Mono<List<MyObject>>?

我正在从RxJava中寻找Single<List<MyObject>> single = observable.toList()的等同物.

I am looking for equivalent of Single<List<MyObject>> single = observable.toList() from RxJava.

使用阻塞运算符,我可以这样:

With blocking operator I can do it like this:

val just: Mono<List<MyObject>> = Mono.just(flux.toIterable().toList())

但是它是在声明时执行的,并不是正确的.

But it is executed at the time of declaration which doesn't seam to be right.

推荐答案

Flux具有方法 查看全文

相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆