在一系列连接运算符 RxJava 之后保留参数

Preserve an argument after a series of concat operators RxJava

是否可以直接访问运算符的第一个参数?我正在尝试使用 zip 运算符保留值,但我还没有成功。感谢帮助

.concatMap(this::getDeviceStatus)
                .concatMap(this::getCertificateResponse)
                .concatMap(deviceCertificateResponse ->
                        CertificateGenerator.generateCert(deviceCertificateResponse))
                .concatMap(aBoolean -> CrlGenerator.observableCrlGenerator(aBoolean,getCertificateResponse ))  // <- I want to use the first argument again in the last concat map

您可以通过嵌套保留上游参数:

Observable.just("initialValue")
    .concatMap(initialValue -> {
        someMethod(initialValue)
            .concatMap(transformedValue -> anotherMethod(initialValue, transformedValue))
    });

此外,当使用 ObservablesflatMaps 时,嵌套可以替换为