我在 Android 上使用 RxJava。我在这里有一段非常简单的代码: Observable> observable =
Observable.create((ObservableOnSubscribe<Observable<Boolean>>) emitter1 -> {
emitter1.onNext(doSomething());
emitter1.onComplete();
}).concatMap(accessToken -> Observable.create((ObservableOnSubscribe<Observable<Boolean>>) emitter2 -> {
emitter2.onNext(doSomethingElse());
emitter2.onComplete();
}).observeOn(Schedulers.io()).subscribeOn(Schedulers.io()));
我想做的事=>
-> Start A
-> A is processing
-> A is ending
-> Start B
-> B is processing
-> B is ending
我实际上得到了什么:
-> Start A
-> A is processing
-> Start B
-> B is processing
-> A is ending
-> B is ending
但是我认为 concatMap 正在等待第一个 observable 结束,然后再启动下一个 ...?