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

RxJava 1.0 versus RxJava 2.0 - which one do I use?

As stated earlier, you are encouraged to use RxJava 2.0 if you can. It will continue to grow and receive new features, while RxJava 1.0 will be maintained for bug fixes. However, there are other considerations that may lead you to use RxJava 1.0.

If you inherit a project that is already using RxJava 1.0, you will likely continue using that until it becomes feasible to refactor to 2.0. You can also check out David Akarnokd's RxJava2Interop project (https://github.com/akarnokd/RxJava2Interop), which converts Rx types from RxJava 1.0 to RxJava 2.0 and vice versa. After you finish this book, you may consider using this library to leverage RxJava 2.0 even if you have the RxJava 1.0 legacy code.

In RxJava, there are several libraries to make several Java APIs reactive and plug into RxJava seamlessly. Just to name a few, these libraries include RxJava-JDBC, RxAndroid, RxJava-Extras, RxNetty, and RxJavaFX. At the time of writing this, only RxAndroid and RxJavaFX have been fully ported to RxJava 2.0 (although many other libraries are following). By the time you are reading this, all major RxJava extension libraries will hopefully be ported to RxJava 2.0.

You will also want to prefer RxJava 2.0 because it was built on much of the hindsight and wisdom gained from RxJava 1.0. It has better performance, simpler APIs, a cleaner approach to backpressure, and a bit more safety when hacking together your own operators.

主站蜘蛛池模板: 四子王旗| 馆陶县| 瑞丽市| 青龙| 汶川县| 合肥市| 肃北| 梧州市| 沧州市| 临湘市| 太原市| 获嘉县| 漳平市| 清原| 白山市| 大关县| 华亭县| 龙泉市| 平果县| 兴海县| 洮南市| 武鸣县| 西吉县| 青海省| 抚松县| 宁武县| 永登县| 长丰县| 桂阳县| 武宣县| 鞍山市| 府谷县| 溧阳市| 泌阳县| 西乌| 收藏| 武夷山市| 延寿县| 家居| 汶上县| 祥云县|