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

Data stream types

Broadly, data streams can be categorized into two types:

  • Cold data streams: There are a number of names by which this is known, such as Cold Source, Cold Observable, and Cold Publisher. These emit data only when one subscribes to it and because of this, all messages produced from start are delivered to the subscriber. If a new Subscriber connects to it, the messages are replayed in ascending order and this is same for any new Subscriber. The Subscriber also has a provision to dictate the rate at which the Publisher should emit messages. These data streams are good candidates for applying reactive backpressure (request(n)), for example, a database cursor or file stream (reading a file).
  • Hot data streams: Again, this has a number of different names, such as Hot Source, Hot Observable, and Hot Publisher. These emit data irrespective of any subscribers connected. When a new Subscriber connects, it just emits the messages from that point in time and cannot replay messages from the start. These cannot pause message emissions, so an alternate mechanism is required to control flow, such as a buffer. Examples of this stream include mouse events and stock prices.

It's important to note that operators on a stream can change their property, going from cold to hot and vice versa. Also, there are times when a merge between hot and cold can happen and their properties change.

主站蜘蛛池模板: 桦川县| 吉林省| 塔城市| 治多县| 华池县| 习水县| 湛江市| 建水县| 太白县| 扶绥县| 南城县| 吴桥县| 石门县| 和林格尔县| 四平市| 通渭县| 威海市| 杭锦后旗| 西昌市| 阳高县| 工布江达县| 武鸣县| 土默特右旗| 武鸣县| 门头沟区| 龙陵县| 闽清县| 淮南市| 桑植县| 城固县| 普陀区| 邵东县| 佛坪县| 刚察县| 唐海县| 贵溪市| 比如县| 澳门| 嘉黎县| 拜泉县| 嘉黎县|