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

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());
主站蜘蛛池模板: 江西省| 苍溪县| 榕江县| 亚东县| 邵阳县| 泰顺县| 云林县| 孟连| 沁阳市| 金平| 蒙山县| 锡林浩特市| 兴安盟| 万州区| 大厂| 昔阳县| 菏泽市| 建德市| 盐边县| 普格县| 克拉玛依市| 呼图壁县| 公主岭市| 烟台市| 萨嘎县| 扎囊县| 乌拉特后旗| 丽水市| 高青县| 金山区| 海盐县| 洛宁县| 巨鹿县| 军事| 宁蒗| 吴堡县| 苍山县| 郓城县| 凌源市| 乌鲁木齐县| 潼南县|