RxJava 嵌套 Zip 操作不返回

RxJava nested Zip operation not returning

我用几个嵌套的可观察对象和两个 Zip 运算符创建了这个长可观察对象。

我的问题是最外面的 Zip 运算符从未调用过它的函数...在这种情况下它是 Func5(...).

我能够调试嵌套的 Zip 运算符并看到 Func6(...) return 和 Map<String, Object> 但是没有任何反应。 subscriber.

中没有 onNextonErroronComplete

我在这里错过了什么?

Zip 运算符 return 是可观察的,所以我认为嵌套是可以的。

Observable.zip(
                UserApi.doThis(someValue)
                        .flatMap(new Func1<String, Observable<typeA1>>() {
                            @Override
                            public Observable<typeA1> call(String photoId) {
                                return UserApi.getUserPhotoData(photoId);
                            }
                        }),
                UserApi.doThat(),
                UserApi.doSomething(settingName0),
                InstitutionApi.getThis(someValue),
                Observable.zip(
                        InstitutionApi.getInstitutionSetting(settingName1).onErrorReturn(new Func1<Throwable, typeB1>() {
                            @Override
                            public typeB1 call(Throwable throwable) {
                                return new typeB1(...);
                            }
                        }),
                        InstitutionApi.getInstitutionSetting(settingName2).onErrorReturn(new Func1<Throwable, typeB1>() {
                            @Override
                            public typeB1 call(Throwable throwable) {
                                return new typeB1(...);
                            }
                        }),
                        InstitutionApi.getInstitutionSetting(settingName3).onErrorReturn(new Func1<Throwable, typeB1>() {
                            @Override
                            public typeB1 call(Throwable throwable) {
                                return new typeB1(...);
                            }
                        }),
                        InstitutionApi.getInstitutionContentString(stringName1).onErrorReturn(new Func1<Throwable, typeB2>() {
                            @Override
                            public typeB2 call(Throwable throwable) {
                                return null;
                            }
                        }),
                        InstitutionApi.getInstitutionSetting(settingName4).onErrorReturn(new Func1<Throwable, typeB1>() {
                            @Override
                            public typeB1 call(Throwable throwable) {
                                return new typeB1(...);
                            }
                        }),
                        InstitutionApi.getInstitutionSetting(settingName5).onErrorReturn(new Func1<Throwable, typeB1>() {
                            @Override
                            public typeB1 call(Throwable throwable) {
                                return new typeB1(...);
                            }
                        }),
                        new Func6<typeB1, typeB1, typeB1, typeB2, typeB1, typeB1, Map<String, Object>>() {
                            @Override
                            public Map<String, Object> call(typeB1 r0, typeB1 r1, typeB1 r2,
                                                                 typeB2 r3, typeB1 r4, typeB1 r5) {
                                Map<String, Object> map = new HashMap<>();
                                try {
                                   // do things
                                } catch (Exception e) {
                                    return null;
                                }
                                return map;
                            }
                        }),
                new Func5<typeA1, typeA2, typeA3, typeA4, Map<String, Object>, EndReturnType>() {
                    @Override
                    public EndReturnType call(typeA1 r0, typeA2 r1, typeA3  r2, typeA4 r3, Map<String, Object> r4) {

                        EndReturnType ert = new EndReturnType ();
                        // do things

                        return ert;
                    }
                });

正如 zsxwing 在评论中提到的,由于缺少 onNext 函数,我的一个函数没有返回值。