Flux 和 Mono 区别

原创转载请注明出处:https://www.cnblogs.com/agilestyle/p/15176531.html

 

Flux

an Asynchronous Sequence of 0-N Items

Flux<String> seq1 = Flux.just("foo", "bar", "foobar");

List<String> iterable = Arrays.asList("foo", "bar", "foobar");
Flux<String> seq2 = Flux.fromIterable(iterable);

Flux<Integer> numbersFromFiveToSeven = Flux.range(5, 3);

 

Mono

an Asynchronous 0-1 Result

Mono<String> noData = Mono.empty();

Mono<String> data = Mono.just("foo");

 

Reference

https://projectreactor.io/docs/core/snapshot/reference/#core-features

 

 


 

欢迎点赞关注和收藏

 

posted @ 2021-08-23 16:34  李白与酒  阅读(586)  评论(0编辑  收藏  举报