简体   繁体   中英

Spring Reactive List of Mono to Flux

I have a

list.stream()
.map(element -> func());

where func() returns with Mono. What is the easiest way to convert this list of Mono<CustomObject> objects to Flux<CustomObject> and return it from the stream?

List<Mono<CustomObject >> monoList = new ArrayList<>();
monoList(object);

Flux<CustomObject> flux = Flux.concat(monoList);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM