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

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.

主站蜘蛛池模板: 茂名市| 招远市| 光山县| 远安县| 甘肃省| 泗阳县| 丽江市| 塘沽区| 泊头市| 封丘县| 钦州市| 册亨县| 斗六市| 安康市| 左贡县| 陇西县| 永善县| 苍梧县| 怀集县| 上犹县| 建阳市| 阿鲁科尔沁旗| 华亭县| 门头沟区| 新平| 延边| 凤山市| 罗平县| 文昌市| 玉环县| 印江| 桃江县| 桐城市| 曲靖市| 西城区| 新泰市| 赞皇县| 奉新县| 灵台县| 寻乌县| 丁青县|