How to convert List> to Mono>?

后端 未结 2 1154
粉色の甜心
粉色の甜心 2021-01-18 00:22

I have a method that returns Mono:

interface Processor {
  Mono process(Input input);
}

And I want

2条回答
  •  南笙
    南笙 (楼主)
    2021-01-18 00:45

    If you don't have to create stream for any reason, you could create Flux from your inputs, map it and collect list

    Flux.fromIterable(inputs).flatMap(processor::process).collectList();
    

提交回复
热议问题