- Reactive Programming in Kotlin
- Rivu Chakraborty
- 120字
- 2021-07-02 22:26:41
Observables
As we discussed earlier, in reactive programming, Observable has an underlying computation that produces values that can be consumed by a consumer (Observer). The most important thing here is that the consumer (Observer) doesn't pull values here; rather, Observable pushes the value to the consumer. So, we may say, an Observable is a push-based, composable iterator that emits its items through a series of operators to the final Observer, which finally consumes the items. Let's now break things sequentially to understand it better:
- Observer subscribes to Observable
- Observable starts emitting items that it has in it
- Observer reacts to whatever item Observable emits
So, let's delve into how an Observable works through its events/methods, namely, onNext, onComplete, and onError.
推薦閱讀
- 有趣的二進制:軟件安全與逆向分析
- Developing Mobile Games with Moai SDK
- Mastering Ninject for Dependency Injection
- Architects of Intelligence
- MySQL基礎教程
- Hadoop與大數據挖掘(第2版)
- 云計算服務保障體系
- INSTANT Cytoscape Complex Network Analysis How-to
- 數據挖掘原理與SPSS Clementine應用寶典
- Python金融實戰
- Spark分布式處理實戰
- 數據挖掘競賽實戰:方法與案例
- 大數據時代系列(套裝9冊)
- Scratch 2.0 Game Development HOTSHOT
- 數據之美:一本書學會可視化設計