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

Creating observables

Most of the code of a ReactiveX application is composed of operators that are chained together. However, at some point, the source of these events must be exposed as observables. ReactiveX provides many ways to create an observable from any source of data. Many factory operators are already available to convert virtually any source of data or event to an observable, and, should none of these operators be applicable to a situation, it is possible to create an operator from custom code logic.

All of the factory operators in RxPY are implemented as static methods of the Observable class. This means that they are invoked by using Observable.xxx, where xxx is the factory operator, and they return an observable. Also, almost all of these operators take a scheduler as an optional parameter. A scheduler allows you to control how the items are emitted on the observable. They are only mentioned in this chapter briefly, and they will be covered in detail in Chapter 5, Concurrency and Paralellism in RxPY.

主站蜘蛛池模板: 淮南市| 翁源县| 东丽区| 丹江口市| 衡阳县| 千阳县| 洪雅县| 萝北县| 彰武县| 瑞丽市| 荔浦县| 淅川县| 长岭县| 克拉玛依市| 南京市| 喀喇沁旗| 阿合奇县| 肥东县| 阿克陶县| 灵璧县| 泽州县| 雅安市| 寻乌县| 抚州市| 麦盖提县| 东阳市| 城口县| 大石桥市| 保亭| 大丰市| 峨眉山市| 崇文区| 临江市| 秭归县| 涟源市| 大理市| 黎城县| 米泉市| 城口县| 湘潭市| 丽水市|