我使用firebase来实时获取对象,我想按顺序(先进先出)执行更多的观察,谢谢!
public void getDispatch(Dispatch dispatch) {
Single<DispatchAction> observable = Single.just(dispatch)
.map(order1 -> {
return convertDispatch(order1);
});
DisposableSingleObserver<DispatchAction> actionDisposableObserver =
new DisposableSingleObserver<DispatchAction>(){
@Override
public void onSuccess(DispatchAction action) {//Process result }
public void onError(Throwable e) {//Error }
};
compositeDisposable.add(
observable
.subscribeOn(Schedulers.single())
.observeOn(AndroidSchedulers.mainThread())
.subscribeWith(actionDisposableObserver)
);
}
暂无答案!
目前还没有任何答案,快来回答吧!