RxJava v2.0.0-RC4 发布,一个实现异步操作的库

jopen 6年前
   <p style="text-align: center;"><img alt="" src="https://simg.open-open.com/show/27e89a5a287f2aa133ed68e1e8b7e831.png" /></p>    <p> </p>    <p>RxJava一个在 Java VM 上使用可观测的序列来组成异步的、基于事件的程序的库。说到根上,它就是一个实现异步操作的库,而别的定语都是基于这之上的。同样是做异步,为什么人们用它,而不用现成的 AsyncTask / Handler / XXX / ... ?,原因是RxJava简洁,异步操作很关键的一点是程序的简洁性,因为在调度过程比较复杂的情况下,异步代码经常会既难写也难被读懂。 Android 创造的 AsyncTask 和Handler ,其实都是为了让异步代码更加简洁。RxJava 的优势也是简洁,但它的简洁的与众不同之处在于,随着程序逻辑变得越来越复杂,它依然能够保持简洁。</p>    <p style="text-align: center;"><a href="https://simg.open-open.com/show/590895c0b975a817143b0f53b870e71b.jpg"><img alt="" src="https://simg.open-open.com/show/590895c0b975a817143b0f53b870e71b.jpg" /></a></p>    <p><a href="https://simg.open-open.com/show/039f09fd6005089241137560455ed074.png"><img alt="" src="https://simg.open-open.com/show/039f09fd6005089241137560455ed074.png" /></a></p>    <p> </p>    <p>更新日志</p>    <p><strong>API增强</strong></p>    <ul>     <li><a href="/misc/goto?guid=4958994259253221857">Pull 4589</a>: Add <code>singleOrError</code>, <code>firstOrError</code>, <code>lastOrError</code> & <code>elementAtOrError</code> to <code>Observable</code> and<code>Flowable</code></li>     <li><a href="/misc/goto?guid=4958994259362103075">Pull 4616</a>: Add <code>Completable.andThen(MaybeSource)</code></li>     <li><a href="/misc/goto?guid=4958994259449281798">Pull 4614</a>: Add <code>Maybe.flatMapSingle</code></li>     <li><a href="/misc/goto?guid=4958994259540263882">Pull 4617</a>: Add <code>Single.flatMapMaybe</code></li>     <li><a href="/misc/goto?guid=4958994259634138997">Pull 4585</a>: Evaluate <code>Schedulers</code> initialization via <code>Callable</code></li>     <li><a href="/misc/goto?guid=4958994259730630688">Pull 4607</a>: <code>TestSubscriber</code> & <code>TestObserver</code> add <code>assertValue(Predicate)</code>.</li>     <li><a href="/misc/goto?guid=4958994259819084791">Pull 4627</a>: Use predicates in <code>BaseTestConsumer.assertError(Class/Throwable)</code> to remove duplicate code, tests tweaks to remove few IDE warnings</li>     <li><a href="/misc/goto?guid=4958994259910561638">Pull 4629</a>: Add <code>Completable.fromRunnable()</code></li>     <li><a href="/misc/goto?guid=4958994260013845647">Pull 4631</a>: <code>TestConsumer</code> don't wrap with <code>CompositeException</code> when there is only one error</li>     <li><a href="/misc/goto?guid=4958994260101834109">Pull 4604</a>: add <code>flattenAs{Observable,Flowable}</code> to <code>Single</code> and <code>Maybe</code></li>     <li><a href="/misc/goto?guid=4958994260196728825">Pull 4658</a>: <code>Observable.compose</code> to use <code>ObservableTransformer</code>.</li>     <li><a href="/misc/goto?guid=4958994260290963306">Pull 4667</a>: Add <code>flatMap{Completable, Maybe, Single}</code> operators to <code>Flowable</code> and <code>Observable</code>.</li>     <li><a href="/misc/goto?guid=4958994260393481399">Pull 4672</a>: Remove <code>Function</code> from transformer interfaces to allow a single obj.</li>     <li><code>Maybe.ignoreElement</code> to return <code>Completable</code>.</li>    </ul>    <p><strong>性能增强</strong></p>    <ul>     <li><a href="/misc/goto?guid=4958994260483226374">Pull 4612</a>: Improve performance of <code>Observable.flatMapIterable</code></li>     <li><a href="/misc/goto?guid=4958994260571295047">Pull 4622</a>: Enable operator fusion in <code>onBackpressureBuffer</code></li>    </ul>    <p><strong>Bug修复</strong></p>    <ul>     <li><a href="/misc/goto?guid=4958994260670732971">Pull 4590</a>: Report errors from <code>onError</code> to Plugin when done.</li>     <li><a href="/misc/goto?guid=4958994260760830139">Pull 4592</a>: <code>UnicastSubject</code> fix <code>onTerminate</code></li>     <li><a href="/misc/goto?guid=4958994260854015999">Pull 4593</a>: Enhance NPE messages</li>     <li><a href="/misc/goto?guid=4958994260945769710">Pull 4603</a>: RxJavaPlugins - Don't pass null throwable down to Error Handler</li>     <li><a href="/misc/goto?guid=4958994261032125724">Pull 4619</a>: Make <code>CompositeExcepetion</code> thread-safe like 1.x and also fix some issues.</li>     <li><a href="/misc/goto?guid=4958994261128401570">Pull 4645</a>: Signal NPE <code>ObservableAmb</code> <code>FlowableAmb</code></li>     <li><a href="/misc/goto?guid=4958994261223314699">Pull 4651</a>: Switch <code>Maybe</code> and <code>Single</code> to use their <code>Transformer</code>s in <code>compose()</code>.</li>     <li><a href="/misc/goto?guid=4958994261309282289">Pull 4654</a>: Upcast <code>ConcurrentHashMap</code> to <code>Map</code> to avoid compatibility issue.</li>    </ul>    <p><strong>Removals</strong></p>    <ul>     <li><a href="/misc/goto?guid=4958994261403063941">Pull 4595</a>: Remove <code>takeFirst(predicate)</code> from <code>Observable</code> & <code>Flowable</code></li>    </ul>    <p><strong>Other</strong></p>    <ul>     <li><a href="/misc/goto?guid=4958994261503826190">Pull 4647</a>: Merge <code>AmbArray</code> and <code>AmbIterable</code> into <code>Amb</code> for <code>Single</code>, <code>Maybe</code> and <code>Completable</code> types.</li>    </ul>    <h2>下载</h2>    <ul>     <li><a href="/misc/goto?guid=4958994261601582464" rel="nofollow"><strong>Source code</strong> (zip)</a></li>     <li><a href="/misc/goto?guid=4958994261689507592" rel="nofollow"><strong>Source code</strong> (tar.gz)</a></li>    </ul>    <p> </p>    <p>本站原创,转载时保留以下信息:<br /> 本文转自:深度开源(open-open.com)<br /> 原文地址:<a href="http://www.open-open.com/news/view/5f505d2c">http://www.open-open.com/news/view/5f505d2c</a></p>