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

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.

主站蜘蛛池模板: 页游| 紫云| 河间市| 恩施市| 长寿区| 沙田区| 新民市| 方城县| 眉山市| 南安市| 赤城县| 怀安县| 福安市| 镇雄县| 扬州市| 泾川县| 望谟县| 怀宁县| 呼伦贝尔市| 绥化市| 昭通市| 甘谷县| 阿瓦提县| 元氏县| 浦县| 霍城县| 旌德县| 正阳县| 万州区| 邵东县| 荣成市| 彰化市| 长沙县| 望城县| 安平县| 平潭县| 兴义市| 瑞丽市| 天气| 托克逊县| 桦甸市|