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

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.

主站蜘蛛池模板: 高安市| 龙南县| 嘉峪关市| 含山县| 南阳市| 自贡市| 若尔盖县| 兴文县| 庄浪县| 芮城县| 根河市| 青田县| 自贡市| 谢通门县| 秀山| 廊坊市| 丁青县| 清新县| 开平市| 嵊泗县| 伊金霍洛旗| 湖口县| 绥江县| 渑池县| 壶关县| 柳州市| 芜湖县| 岳池县| 淳化县| 土默特左旗| 凤冈县| 保亭| 兖州市| 兴城市| 成都市| 清水河县| 和林格尔县| 白山市| 鄂托克前旗| 邹平县| 固镇县|