简体   繁体   中英

How to convert List<Mono<String>> into Flux<List<String>>?

List<Mono<String>> responses = apiCall()

I would like to get Flux<String> to await all mono-s from list.

How could I achieve it?

PS

I've found similar question but I need vice versa operation https://stackoverflow.com/a/44040346/2674303

You could use Flux.mergeSequential() and Flux.collectList()

Mono<List<String>> list = Flux.mergeSequential(apiCall()).collectList();

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