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

Reactive Streams

Reactive Streams is a specification that determines the minimum set of interfaces required to build the asynchronous processing of a large volume of unbounded data. It is a specification aimed at JVM and JavaScript runtime. The main goal of the Reactive Streams specification is to standardize the exchange of stream data across an asynchronous boundary of applications. The API consists of the following four interfaces:

  1. Publisher: The publisher is responsible for the generation of an unbounded number of asynchronous events and pushing those events to the associated subscribers.

  2. Subscriber: The subscriber is a consumer of the events published by a publisher. The subscriber gets events for subscription, data, completion, and error. It can choose to perform actions on any of them.

  3. Subscription: A subscription is a shared context between the publisher and subscriber, for the purpose of mediating the data exchange between the two. The subscription is available with the subscriber only, and enables it to control the flow of events from the publisher. The subscription becomes invalid if there is an error or a completion. A subscriber can also cancel the subscriptions, in order to close its stream.

  4. Processor: The processor represents a stage of data processing between a subscriber and a publisher. Consequently, it is bound by both of them. The processor has to obey the contract between the publisher and the subscriber. If there is an error, it must propagate it back to the subscriber.

The Reactive Streams specification is the result of a collaborative effort of engineers from Kaazing, Netflix, Pivotal, Red Hat, Twitter, Typesafe, and many other companies.

While there are only four interfaces, there are around 30 rules that govern the data exchange between the publisher and the subscriber. These rules are based on the two principles covered in the following sections.

主站蜘蛛池模板: 汶上县| 双鸭山市| 莱西市| 轮台县| 稻城县| 临城县| 阳泉市| 连平县| 榕江县| 古蔺县| 韶山市| 衡东县| 长治市| 安仁县| 仙游县| 高清| 正安县| 昌江| 樟树市| 盈江县| 建昌县| 兰西县| 钟山县| 青海省| 罗山县| 云南省| 杭锦后旗| 观塘区| 普陀区| 绍兴县| 玉环县| 鹰潭市| 厦门市| 蓬莱市| 伊金霍洛旗| 垦利县| 浦江县| 阿鲁科尔沁旗| 封丘县| 临颍县| 涿州市|