RxJava的又一个版本: RxJava3

RxJava出3啦

早上看见一个库支持RxJava3, 还以为自己眼花了, 查了下果然是出RxJava3了.

RxJava2会怎样呢?

RxJava2会进入维护状态, 只有bugfix的改动, 不会有新feature, 到February 28, 2021将会停止所有2.0的开发.

With the release of RxJava 3.0.0, the previous version line, 2.2.x, is in maintenance mode. 

This means only bugfixes will be accepted and applied; no new operators or documentation changes will be accepted or applied.

:information_source: 2.x will be supported until February 28, 2021, after which all development on that branch will stop.

RxJava2和RxJava3可以共存.

为了解决逐步迁移过程中, RxJava2和RxJava3互相调用的问题, 有一个外部的library: https://github.com/akarnokd/RxJavaBridge#rxjavabridge

RxJava3依赖添加

之前RxJava1是这样的:

implementation 'io.reactivex:rxjava:1.3.0

RxJava2是这样的:

implementation 'io.reactivex.rxjava2:rxjava:2.0.9'

现在RxJava3是这样的:

implementation 'io.reactivex.rxjava3:rxjava:3.0.0'

主要改变

Java 8

因为Android Studio 4.0的desugaring, 见: Java 8 library desugaring in D8 and R8, 使用Java 8的一些APIs, 不再限制app的最小API level.

所以RxJava的基准也变为Java 8.

Package

一些包名的改变.
现在的包都是: io.reactivex.rxjava3.

行为改变 Behavior changes

  • More undeliverable errors
  • Connectable source reset
  • Flowable.publish pause
  • Processor.offer null-check
  • MulticastProcessor.offer fusion-check
  • Group abandonment in groupBy
  • Backpressure in groupBy
  • Window abandonment in window
  • CompositeException cause generation
  • Parameter validation exception change
  • From-callbacks upfront cancellation
  • Using cleanup order

API改变

  • Functional interfaces
  • New Types
  • Moved components
  • API promotions
  • API additions
  • Java 8 additions
  • API renames
  • API signature changes
  • API removals

这两部分太长太具体了, 这里只是列出来项目, 大家自己点去原文看吧. What's different in 3.0

参考

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • mean to add the formatted="false" attribute?.[ 46% 47325/...
    ProZoom阅读 2,735评论 0 3
  • pyspark.sql模块 模块上下文 Spark SQL和DataFrames的重要类: pyspark.sql...
    mpro阅读 9,545评论 0 13
  • 一、Retrofit详解 ·Retrofit的官网地址为 : http://square.github.io/re...
    余生_d630阅读 1,935评论 0 5
  • 组装: 5.外壳(颜色、Logo) 6.电源线(规格、长度) 7.点烟插(材料、有无刻字、是否带灯) 8.保险丝规...
    独到_ideaman_简解阅读 373评论 0 0
  • 另外三家有一个共同点都是用自己的公寓改造成青旅。在小区里面,位置不好找。 ② 广州小窝青年旅社 人均¥60 ...
    南瓜的南西瓜的西阅读 375评论 0 0