RxJava v2.0.0-RC4 發布,一個實現異步操作的庫
RxJava一個在 Java VM 上使用可觀測的序列來組成異步的、基于事件的程序的庫。說到根上,它就是一個實現異步操作的庫,而別的定語都是基于這之上的。同樣是做異步,為什么人們用它,而不用現成的 AsyncTask / Handler / XXX / ... ?,原因是RxJava簡潔,異步操作很關鍵的一點是程序的簡潔性,因為在調度過程比較復雜的情況下,異步代碼經常會既難寫也難被讀懂。 Android 創造的 AsyncTask 和Handler ,其實都是為了讓異步代碼更加簡潔。RxJava 的優勢也是簡潔,但它的簡潔的與眾不同之處在于,隨著程序邏輯變得越來越復雜,它依然能夠保持簡潔。
更新日志
API增強
- Pull 4589: Add
singleOrError
,firstOrError
,lastOrError
&elementAtOrError
toObservable
andFlowable
- Pull 4616: Add
Completable.andThen(MaybeSource)
- Pull 4614: Add
Maybe.flatMapSingle
- Pull 4617: Add
Single.flatMapMaybe
- Pull 4585: Evaluate
Schedulers
initialization viaCallable
- Pull 4607:
TestSubscriber
&TestObserver
addassertValue(Predicate)
. - Pull 4627: Use predicates in
BaseTestConsumer.assertError(Class/Throwable)
to remove duplicate code, tests tweaks to remove few IDE warnings - Pull 4629: Add
Completable.fromRunnable()
- Pull 4631:
TestConsumer
don't wrap withCompositeException
when there is only one error - Pull 4604: add
flattenAs{Observable,Flowable}
toSingle
andMaybe
- Pull 4658:
Observable.compose
to useObservableTransformer
. - Pull 4667: Add
flatMap{Completable, Maybe, Single}
operators toFlowable
andObservable
. - Pull 4672: Remove
Function
from transformer interfaces to allow a single obj. Maybe.ignoreElement
to returnCompletable
.
性能增強
- Pull 4612: Improve performance of
Observable.flatMapIterable
- Pull 4622: Enable operator fusion in
onBackpressureBuffer
Bug修復
- Pull 4590: Report errors from
onError
to Plugin when done. - Pull 4592:
UnicastSubject
fixonTerminate
- Pull 4593: Enhance NPE messages
- Pull 4603: RxJavaPlugins - Don't pass null throwable down to Error Handler
- Pull 4619: Make
CompositeExcepetion
thread-safe like 1.x and also fix some issues. - Pull 4645: Signal NPE
ObservableAmb
FlowableAmb
- Pull 4651: Switch
Maybe
andSingle
to use theirTransformer
s incompose()
. - Pull 4654: Upcast
ConcurrentHashMap
toMap
to avoid compatibility issue.
Removals
- Pull 4595: Remove
takeFirst(predicate)
fromObservable
&Flowable
Other
- Pull 4647: Merge
AmbArray
andAmbIterable
intoAmb
forSingle
,Maybe
andCompletable
types.
下載
本站原創,轉載時保留以下信息:
本文轉自:深度開源(open-open.com)
原文地址:http://www.baiduhome.net/news/view/5f505d2c
本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!