public final class AsyncStreamingResponseHandler<OutputT extends SdkResponse,ReturnT> extends Object implements TransformingAsyncResponseHandler<ReturnT>
| Constructor and Description |
|---|
AsyncStreamingResponseHandler(AsyncResponseTransformer<OutputT,ReturnT> asyncResponseTransformer) |
| Modifier and Type | Method and Description |
|---|---|
void |
onError(Throwable error)
Called when there is an error making the request or receiving the response.
|
void |
onHeaders(SdkHttpResponse response)
Called when the headers have been received.
|
void |
onStream(org.reactivestreams.Publisher<ByteBuffer> publisher)
Called when the streaming body is ready.
|
CompletableFuture<ReturnT> |
prepare()
Return the future holding the transformed response.
|
void |
responseHandler(HttpResponseHandler<OutputT> responseHandler) |
public AsyncStreamingResponseHandler(AsyncResponseTransformer<OutputT,ReturnT> asyncResponseTransformer)
public void responseHandler(HttpResponseHandler<OutputT> responseHandler)
public void onHeaders(SdkHttpResponse response)
SdkAsyncHttpResponseHandleronHeaders in interface SdkAsyncHttpResponseHandlerresponse - The headers.public void onStream(org.reactivestreams.Publisher<ByteBuffer> publisher)
SdkAsyncHttpResponseHandlerThis method is always called. If the response does not have a body, then the publisher will complete the subscription without signalling any elements.
onStream in interface SdkAsyncHttpResponseHandlerpublisher - The streaming body.public void onError(Throwable error)
SdkAsyncHttpResponseHandlerSubscriber.onError in interface SdkAsyncHttpResponseHandlererror - The error.public CompletableFuture<ReturnT> prepare()
TransformingAsyncResponseHandler
This method is guaranteed to be called before the request is executed, and before SdkAsyncHttpResponseHandler.onHeaders(com.ibm.cos.v2.http.SdkHttpResponse) is signaled.
prepare in interface TransformingAsyncResponseHandler<ReturnT>Copyright © 2026. All rights reserved.