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

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.

主站蜘蛛池模板: 双流县| 汨罗市| 合肥市| 广东省| 嘉义县| 延边| 亚东县| 应城市| 莆田市| 徐州市| 阳高县| 大同县| 宜州市| 武宁县| 松阳县| 得荣县| 吉首市| 辽源市| 元江| 海安县| 镇沅| 盱眙县| 揭东县| 辽宁省| 岑巩县| 锡林郭勒盟| 大连市| 双桥区| 昭苏县| 根河市| 彰武县| 板桥市| 蛟河市| 横峰县| 吉安县| 安远县| 威海市| 麻城市| 古丈县| 余江县| 婺源县|