为什么 netty 客户端 return Observable<Observable<ByteBuf>> 而不是 Observable<ByteBuf>?

why does netty client return Observable<Observable<ByteBuf>> instead of Observable<ByteBuf>?

教程/示例展示:

Observable<HttpClientResponse<ByteBuf>> httpGet =
                                          RxNetty.createHttpGet("http://xxxx");
Observable<Observable<ByteBuf>> byteBuffers =
                                     httpGet.map(HttpClientResponse::getContent);

我知道字节可能以块的形式出现,因此我理解 Observable<ByteBuf> 的需要。

但为什么 Observable<HttpClientResponse>?为什么不只有 1 个 HttpClientResponse 提供 Observable<ByteBuf>?或者实际上它只是包裹在 Observable 中的 Single<HttpClientResponse> 让 api 更流畅?但在这种情况下是否有一些文档?

是的,它本质上是一个 Single<HttpClientResponse>。由于这些 API 是在 RxJava 中引入 Single 之前创建的,因此它们不使用 Single