Mono vs Flux in Reactive Stream

前端 未结 3 2108
闹比i
闹比i 2020-12-24 01:10

As per the documentation:

Flux is a stream which can emit 0..N elements:

Flux fl = Flux.just(\"a\", \"b\",         


        
3条回答
  •  悲哀的现实
    2020-12-24 01:39

    Flux is equivalent to RxJava Observable is capable of emitting
    - zero or more item (streams of many elements)
    - and then OPTIONALLY , completing OR failing

    Mono can only emit one item at the most (streams one element)

    Relations:

    • If you concatente two Monos you will get a Flux
    • You can call single() on Flux to return a Mono

提交回复
热议问题