RxJava v1.2.0 发布,一个实现异步操作的库
jopen 8年前
<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> <h2>更新日志</h2> <p>促进@Beta标准</p> <ul> <li>in <code>rx.Observable</code> <ul> <li><code>create(SyncOnSubscribe<S, T>)</code></li> <li><code>doOnRequest(Action1<Long>)</code></li> <li><code>flatMap(Func1<? super T, ? extends Observable<? extends R>>, Func1<? super Throwable, ? extends Observable<? extends R>>, Func0<? extends Observable<? extends R>>, int)</code></li> <li><code>flatMap(Func1<? super T, ? extends Observable<? extends R>>, int)</code></li> <li><code>flatMap(Func1<? super T, ? extends Observable<? extends U>>, Func2<? super T, ? super U, ? extends R>, int)</code></li> <li><code>flatMapIterable(Func1<? super T, ? extends Iterable<? extends R>>, int) rx.Observable.flatMapIterable(Func1<? super T, ? extends Iterable<? extends U>>, Func2<? super T, ? super U, ? extends R>, int)</code></li> <li><code>fromCallable(Callable<? extends T>)</code></li> <li><code>toSingle()</code></li> </ul> </li> <li><code>rx.Single</code> (the class itself) <ul> <li><code>fromCallable(Callable<? extends T>)</code></li> </ul> </li> <li><code>rx.SingleSubscriber<T></code></li> <li>in <code>rx.observables.ConnectableObservable</code> <ul> <li><code>autoConnect()</code></li> <li><code>autoConnect(int, Action1<? super Subscription>)</code></li> <li><code>autoConnect(int)</code></li> </ul> </li> <li><code>rx.observables.SyncOnSubscribe<S, T></code></li> <li>in <code>rx.subjects.AsyncSubject</code> <ul> <li><code>getThrowable()</code></li> <li><code>getValue()</code></li> <li><code>hasCompleted()</code></li> <li><code>hasThrowable()</code></li> <li><code>hasValue()</code></li> </ul> </li> <li>in <code>rx.subjects.BehaviorSubject</code> <ul> <li><code>getThrowable()</code></li> <li><code>getValue()</code></li> <li><code>getValues()</code></li> <li><code>getValues(T[])</code></li> <li><code>hasCompleted()</code></li> <li><code>hasThrowable()</code></li> <li><code>hasValue()</code></li> </ul> </li> <li>in <code>rx.subjects.PublishSubject</code> <ul> <li><code>getThrowable()</code></li> <li><code>hasCompleted()</code></li> <li><code>hasThrowable()</code></li> </ul> </li> <li>in <code>rx.subjects.ReplaySubject</code> <ul> <li><code>getThrowable()</code></li> <li><code>getValue()</code></li> <li><code>getValues()</code></li> <li><code>getValues(T[])</code></li> <li><code>hasAnyValue()</code></li> <li><code>hasCompleted()</code></li> <li><code>hasThrowable()</code></li> <li><code>hasValue()</code></li> <li><code>size()</code></li> </ul> </li> </ul> <p>促进@Experimental到@Beta</p> <ul> <li><code>rx.BackpressureOverflow</code></li> <li>in <code>rx.Observable</code> <ul> <li><code>concatDelayError(Iterable<? extends Observable<? extends T>>)</code></li> <li><code>concatDelayError(Observable<? extends Observable<? extends T>>)</code></li> <li><code>concatEager(Iterable<? extends Observable<? extends T>>, int)</code></li> <li><code>concatEager(Iterable<? extends Observable<? extends T>>)</code></li> <li><code>concatEager(Observable<? extends Observable<? extends T>>, int)</code></li> <li><code>concatEager(Observable<? extends Observable<? extends T>>)</code></li> <li><code>concatEager(Observable<? extends T>, Observable<? extends T>, Observable<? extends T>, Observable<? extends T>, Observable<? extends T>, Observable<? extends T>, Observable<? extends T>, Observable<? extends T>, Observable<? extends T>)</code></li> <li><code>concatEager(Observable<? extends T>, Observable<? extends T>, Observable<? extends T>, Observable<? extends T>, Observable<? extends T>, Observable<? extends T>, Observable<? extends T>, Observable<? extends T>)</code></li> <li><code>concatEager(Observable<? extends T>, Observable<? extends T>, Observable<? extends T>, Observable<? extends T>, Observable<? extends T>, Observable<? extends T>, Observable<? extends T>)</code></li> <li><code>concatEager(Observable<? extends T>, Observable<? extends T>, Observable<? extends T>, Observable<? extends T>, Observable<? extends T>, Observable<? extends T>)</code></li> <li><code>concatEager(Observable<? extends T>, Observable<? extends T>, Observable<? extends T>, Observable<? extends T>, Observable<? extends T>)</code></li> <li><code>concatEager(Observable<? extends T>, Observable<? extends T>, Observable<? extends T>, Observable<? extends T>)</code></li> <li><code>concatEager(Observable<? extends T>, Observable<? extends T>, Observable<? extends T>)</code></li> <li><code>concatEager(Observable<? extends T>, Observable<? extends T>)</code></li> <li><code>concatMapDelayError(Func1<? super T, ? extends Observable<? extends R>>)</code></li> <li><code>concatMapEager(Func1<? super T, ? extends Observable<? extends R>>, int, int)</code></li> <li><code>concatMapEager(Func1<? super T, ? extends Observable<? extends R>>, int)</code></li> <li><code>concatMapEager(Func1<? super T, ? extends Observable<? extends R>>)</code></li> <li><code>delaySubscription(Observable<U>)</code></li> <li><code>distinctUntilChanged(Func2<? super T, ? super T, Boolean>)</code></li> <li><code>mergeDelayError(Observable<? extends Observable<? extends T>>, int)</code></li> <li><code>onBackpressureBuffer(long, Action0, Strategy)</code></li> <li><code>switchMapDelayError(Func1<? super T, ? extends Observable<? extends R>>)</code></li> <li><code>switchOnNextDelayError(Observable<? extends Observable<? extends T>>)</code></li> <li><code>toCompletable()</code></li> <li><code>toSortedList(Func2<? super T, ? super T, Integer>, int)</code></li> <li><code>toSortedList(int)</code></li> <li><code>using(Func0<Resource>, Func1<? super Resource, ? extends Observable<? extends T>>, Action1<? super Resource>, boolean)</code></li> </ul> </li> <li>in <code>rx.observables.BlockingObservable</code> <ul> <li><code>subscribe()</code></li> <li><code>subscribe(Action1<? super T>, Action1<? super Throwable>, Action0)</code></li> <li><code>subscribe(Action1<? super T>, Action1<? super Throwable>)</code></li> <li><code>subscribe(Action1<? super T>)</code></li> <li><code>subscribe(Observer<? super T>)</code></li> <li><code>subscribe(Subscriber<? super T>)</code></li> </ul> </li> <li><code>rx.Completable</code></li> <li>in <code>rx.Single</code> <ul> <li><code>defer(Callable<Single<T>>)</code></li> <li><code>delay(long, TimeUnit, Scheduler)</code></li> <li><code>delay(long, TimeUnit)</code></li> <li><code>delaySubscription(Observable<?>)</code></li> <li><code>doAfterTerminate(Action0)</code></li> <li><code>doOnError(Action1<Throwable>)</code></li> <li><code>doOnSubscribe(Action0)</code></li> <li><code>doOnSuccess(Action1<? super T>)</code></li> <li><code>doOnUnsubscribe(Action0)</code></li> <li><code>lift(Operator<? extends R, ? super T>)</code></li> <li><code>onErrorResumeNext(Func1<Throwable, ? extends Single<? extends T>>)</code></li> <li><code>onErrorResumeNext(Single<? extends T>)</code></li> <li><code>toBlocking()</code></li> <li><code>toCompletable()</code></li> <li><code>using(Func0<Resource>, Func1<? super Resource, ? extends Single<? extends T>>, Action1<? super Resource>, boolean)</code></li> <li><code>using(Func0<Resource>, Func1<? super Resource, ? extends Single<? extends T>>, Action1<? super Resource>)</code></li> </ul> </li> <li><code>rx.exceptions.CompositeException.CompositeException(Throwable...)</code></li> <li>in <code>rx.exceptions.Exceptions</code> <ul> <li><code>throwOrReport(Throwable, Observer<?>, Object)</code></li> <li><code>throwOrReport(Throwable, Observer<?>)</code></li> <li><code>throwOrReport(Throwable, SingleSubscriber<?>)</code></li> <li><code>rx.singles.BlockingSingle<T></code></li> </ul> </li> </ul> <p>去除</p> <ul> <li>in <code>rx.Observable</code> <ul> <li><code>extend(Func1<OnSubscribe<T>, R>)</code> : use <code>to(Func1)</code> instead</li> <li><code>fromAsync()</code> : renamed to <code>fromEmitter()</code></li> </ul> </li> <li>in <code>rx.Completable</code> <ul> <li><code>CompletableSubscriber</code> : now <code>rx.CompletableSubscriber</code></li> <li><code>CompletableOnSubscribe</code> : renamed to <code>Completable.OnSubscribe</code></li> <li><code>CompletableOperator</code> : renamed to <code>Completable.Operator</code></li> <li><code>CompletableTransformer</code> : renamed to <code>Completable.Transformer</code></li> </ul> </li> </ul> <h2>下载</h2> <ul> <li><a href="/misc/goto?guid=4958993858749600763" rel="nofollow"><strong>Source code</strong> (zip)</a></li> <li><a href="/misc/goto?guid=4958993858850938136" 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/1f736dbf">http://www.open-open.com/news/view/1f736dbf</a></p>