官术网_书友最值得收藏!

The Flux.from methods

The From methods can be used to generate a Flux from various sources, such as arrays, collections, and so on. In this case, all of the values are identified as multi-valued datasets beforehand. The generated Flux publishes the value events for each value in the original dataset, followed by a completion event. The offered methods have the following variants:

  • Flux.fromArray: This is used to build a stream from an array of a type.
  • Flux.fromIterable: This is used to build a stream from collections. All collections are of the Iterable<T> type, which can be passed to this to generate the intended stream.
  • Flux.fromStream: This is used to build a Flux from an existing Java 8 stream or a Java 8 stream supplier. Consider the following code:
Flux.fromArray(new Integer[]{1,1,2,3,5,8,13});
Flux.fromIterable(Arrays.asList("Red", "Blue", "Yellow", "Black"));
Flux.fromStream(IntStream.range(1,100).boxed());
主站蜘蛛池模板: 遂川县| 五指山市| 信阳市| 衡阳县| 乐东| 霸州市| 甘南县| 扬中市| 柳河县| 全南县| 屏南县| 白山市| 曲水县| 康乐县| 镇康县| 南澳县| 东辽县| 阿瓦提县| 古丈县| 萝北县| 梅州市| 彰化市| 合肥市| 纳雍县| 靖江市| 隆林| 临武县| 丰县| 凤庆县| 通化县| 高州市| 大关县| 交城县| 博乐市| 上犹县| 中江县| 东乡| 集安市| 木兰县| 山东省| 神农架林区|