public static interface HttpLifecycleObserver.HttpResponseObserver
The response is considered complete when one of the terminal events is invoked. It is guaranteed that only one terminal event will be invoked per response.
| Modifier and Type | Method and Description |
|---|---|
default void |
onResponseCancel()
Callback when the response is cancelled.
|
default void |
onResponseComplete()
Callback when the response completes successfully.
|
default void |
onResponseData(Buffer data)
Callback when a response payload body data chunk was observed.
|
default void |
onResponseDataRequested(long n)
Callback when the subscriber requests
n items of the response payload body. |
default void |
onResponseError(Throwable cause)
Callback when the response fails with an error.
|
default void |
onResponseTrailers(HttpHeaders trailers)
Callback when response trailers were observed.
|
default void onResponseDataRequested(long n)
n items of the response payload body.
May be invoked multiple times and concurrently with other callbacks on this observer. Therefore, it should
have its own isolated state or should be synchronized if the state is shared with other callbacks.
It can help to track when items are requested and when they are delivered.
n - number of requested itemsdefault void onResponseData(Buffer data)
May be invoked multiple times if the payload body is split into multiple chunks. All invocations are
sequential between this and other callbacks except onResponseDataRequested(long).
data - the response payload body data chunkdefault void onResponseTrailers(HttpHeaders trailers)
May be invoked zero times (if no trailers are present in the response) or once after all
response data chunks are observed.
trailers - trailers of the responsedefault void onResponseComplete()
This is one of the possible terminal events.
default void onResponseError(Throwable cause)
This is one of the possible terminal events.
cause - Throwable that terminated this responsedefault void onResponseCancel()
This is one of the possible terminal events. Cancellation is the best effort, more events may be signaled after cancel.