repeatWhen and retryWhen are fairly baffling at first glance. For starters, they are serious contenders for "most confusing marble diagrams": They're useful operators: they allow you to conditionally resubscribe to Observables that have terminated. I recently studied how they worked and I want to try to explain them (since it took me a while to grasp). Repeat vs. Retry First of all, what is the di
Suppose I have some Data that I query from the network. I could simply hit the network each time I need the data, but caching the data on disk and in memory would be much more efficient. More specifically, I want a setup that: Occasionally performs queries from the network for fresh data. Retrieves data as quickly as possible otherwise (by caching network results). I'd like to present an implement
The first step to rx-ify our architecture was to change the methods in the data layer so that they returned Observables. The next question was: how do we unit test this? The ugly wayThe first thing that came to our minds was to simply subscribe in the same way we would from outside the tests and then save the result in a global variable that can later on be asserted. For example, imagine we have a
One nice aspect of RxJava is that you can see how data is transformed through a series of operators: Observable.from(someSource) .map(data -> manipulate(data)) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(data -> doSomething(data)); What if you have a set of operators that you want to reuse for multiple streams? For example, I frequently use subscribeOn() and
public interface Observer <T> { void onCompleted(); void onError(java.lang.Throwable throwable); void onNext(T t); } public class Observable <T> { public final static <T> Observable<T> create(OnSubscribe<T> f) public rx.Subscription subscribe(rx.Observer<? super T> observer) // ... } public static interface OnSubscribe<T> extends Action1<Subscriber<? super T>> {} public interface Subscription { pu
After 2+ years of internal and open source development, 3600+ commits, 100+ releases, and with the help of 97 contributors RxJava has hit version 1.0.0. Thank you @headinthebox @zsxwing @samuelgruetter @akarnokd @quidryan @DavidMGross @abersnaze @jmhofer @mairbek @mttkay @daveray @mattrjacobs @michaeldejong @MarioAriasC @johngmyers @pron @jbripley @davidmoten @gliptak @johnhmarks @jloisel @billyy
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く