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

The Flux API

Flux<T> is a general purpose reactive publisher. It represents a stream of asynchronous events with zero or more values, optionally terminated by either a completion signal or an error. It is important to note that a Flux emits the following three events:

  • Value refers to the values generated by the publisher
  • Completion refers to a normal termination of the stream
  • Error refers to an erroneous termination of the stream:

 All of the preceding events are optional. This can lead to streams of the following types:

  • Infinite stream: A publisher generating only value events, and no terminal events (completion and error)
  • Infinite empty stream: A stream generating no value events and no terminating events
  • Finite stream: A publisher generating N finite values, followed by a terminal event
  • Empty stream: A publisher generating no value events, and only terminal events

Flux supports the generation of all preceding variations, so it can be used for most of the generic use cases. It can also generate sequences of alerts for an application. The alerts are an infinite stream of values, with no terminal. Flux can also be used to stream order data from an order database. The order values get terminated at the last order value. It may be the case that there are no orders for a particular product type, making the stream empty for that type.

主站蜘蛛池模板: 彰化县| 广水市| 阜城县| 南部县| 邵阳市| 通榆县| 郧西县| 驻马店市| 荆门市| 祁东县| 抚远县| 乳山市| 禄劝| 台前县| 登封市| 宜春市| 榆林市| 应城市| 临武县| 宝坻区| 郯城县| 日照市| 民勤县| 河间市| 嘉荫县| 乃东县| 涡阳县| 黄陵县| 凤山市| 襄垣县| 汝南县| 桓台县| 什邡市| 板桥市| 铜山县| 哈尔滨市| 石林| 湘乡市| 玉门市| 吴旗县| 庆安县|