- Hands-On Reactive Programming with Reactor
- Rahul Sharma
- 339字
- 2021-08-13 15:22:50
ReactiveX
Reactive Extensions, also known as ReactiveX, enable us to express the asynchronous events in an application as a set of observable sequences. Other applications can subscribe to these observables, in order to receive notifications of events that are occurring. A producer can then push these notification events to a consumer as they arrive. Alternatively, if a consumer is slow, it can pull notification events according to its own consumption rate. The end-to-end system of a producer and its consumers is known as a pipeline. It is important to note that pipelines are lazy by default and do not materialize until they are subscribed to by a consumer. This is very different from eager Java types, like Future, which represent active work. The ReactiveX API consists of the following components:
- Observables: Observables represent the core concept of ReactiveX. They represent the sequences of emitted items, and they generate events that are propagated to the intended subscribers.
- Observer: Any application can express its intent for events published by an observable by creating an observer and subscribing to the respective observable. The intent is expressed in terms of the OnNext, OnCompleted, and OnError methods. Each observable sends a stream of events, followed by a completion event, which executes these methods.
- Operators: Operators enable us to transform, combine, and manipulate the sequences of items emitted by observables. The operators on an observable provide a new observable, and thus, they can be tied together. They do not work independently on the original observable; instead, they work on the observable generated by the previous operator to generate a new observable. The complete operator chain is lazy. It is not evaluated until an observer is subscribed to it. The complete chain is shown as follows:

ReactiveX provides the architecture design to build reactive applications. Individual libraries were built around it in different imperative languages to enable its use. These abstractions allow us to build asynchronous, non-blocking applications, and provide the additional benefits listed in the following sections.
- Visual Basic從初學到精通
- SharePoint 2010開發最佳實踐
- Photoshop CS3圖層、通道、蒙版深度剖析寶典
- 具比例時滯遞歸神經網絡的穩定性及其仿真與應用
- Ruby on Rails敏捷開發最佳實踐
- 網絡安全管理實踐
- Practical Big Data Analytics
- 單片機技能與實訓
- 寒江獨釣:Windows內核安全編程
- 3ds Max造型表現藝術
- Linux Shell Scripting Cookbook(Third Edition)
- Mastering Predictive Analytics with scikit:learn and TensorFlow
- Redash v5 Quick Start Guide
- 系統建模與控制導論
- 實戰大數據(Hadoop+Spark+Flink):從平臺構建到交互式數據分析(離線/實時)