- 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.
推薦閱讀
- MySQL高可用解決方案:從主從復制到InnoDB Cluster架構
- 計算機信息技術基礎實驗與習題
- 云計算服務保障體系
- 算法與數據中臺:基于Google、Facebook與微博實踐
- Oracle高性能自動化運維
- 達夢數據庫性能優化
- Remote Usability Testing
- OracleDBA實戰攻略:運維管理、診斷優化、高可用與最佳實踐
- 數據庫原理與設計(第2版)
- SQL應用及誤區分析
- PostgreSQL指南:內幕探索
- 深入理解InfluxDB:時序數據庫詳解與實踐
- Visual Studio 2013 and .NET 4.5 Expert Cookbook
- R Machine Learning Essentials
- 企業大數據處理:Spark、Druid、Flume與Kafka應用實踐