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

  • Learning RxJava
  • Thomas Nield
  • 291字
  • 2021-07-02 22:22:49

Setting up

There are two co-existing versions of RxJava currently: 1.0 and 2.0. We will go through some of the major differences later and discuss which version you should use.

RxJava 2.0 is a fairly lightweight library and comes just above 2 Megabytes (MBs) in size. This makes it practical for Android and other projects that require a low dependency overhead. RxJava 2.0 has only one dependency, called Reactive Streams ( http://www.reactive-streams.org/), which is a core library (made by the creators of RxJava) that sets a standard for asynchronous stream implementations, one of which is RxJava 2.0.

It may be used in other libraries beyond RxJava and is a critical effort in the standardization of reactive programming on the Java platform. Note that RxJava 1.0 does not have any dependencies, including Reactive Streams, which was realized after 1.0.

 If you are starting a project from scratch, try to use RxJava 2.0. This is the version we will cover in this book, but I will call out significant differences in 1.0. While RxJava 1.0 will be supported for a good while due to countless projects using it, innovation will likely only continue onward in RxJava 2.0. RxJava 1.0 will only get maintenance and bug fixes.

Both RxJava 1.0 and 2.0 run on Java 1.6+. In this book, we will use Java 8, and it is recommended that you use a minimum of Java 8 so you can use lambdas out of the box. For Android, there are ways to leverage lambdas in earlier Java versions that will be addressed later. But weighing the fact that Android Nougat uses Java 8 and Java 8 has been out since 2014, hopefully, you will not have to do any workarounds to leverage lambdas.

主站蜘蛛池模板: 宜章县| 白银市| 墨玉县| 磐石市| 高要市| 黎川县| 乐业县| 曲麻莱县| 肥东县| 三门峡市| 托克托县| 青浦区| 垦利县| 高尔夫| 彭州市| 常熟市| 屏山县| 宁武县| 昭平县| 张掖市| 饶阳县| 浠水县| 永川市| 乌兰察布市| 青河县| 获嘉县| 陵水| 交口县| 海林市| 长乐市| 灵川县| 佛山市| 南岸区| 普定县| 玉树县| 习水县| 清涧县| 嘉善县| 连州市| 城口县| 古交市|