public static interface HttpLifecycleObserver.HttpRequestObserver
The request is considered complete when one of the terminal events is invoked. It is guaranteed that only one terminal event will be invoked per request.
| Modifier and Type | Method and Description |
|---|---|
default void |
onRequestCancel()
Callback if the request is cancelled.
|
default void |
onRequestComplete()
Callback if the request completes successfully.
|
default void |
onRequestData(Buffer data)
Callback when a request payload body data chunk was observed.
|
default void |
onRequestDataRequested(long n)
Callback when the subscriber requests
n items of the request payload body. |
default void |
onRequestError(Throwable cause)
Callback if the request fails with an error.
|
default void |
onRequestTrailers(HttpHeaders trailers)
Callback when request trailers were observed.
|
default void onRequestDataRequested(long n)
n items of the request 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 onRequestData(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 onRequestDataRequested(long).
data - the request payload body data chunkdefault void onRequestTrailers(HttpHeaders trailers)
May be invoked zero times (if no trailers are present in the request) or once after all
request data chunks are observed.
trailers - trailers of the requestdefault void onRequestComplete()
This is one of the possible terminal events.
default void onRequestError(Throwable cause)
This is one of the possible terminal events.
cause - Throwable that fails this requestdefault void onRequestCancel()
This is one of the possible terminal events. Cancellation is the best effort, more events may be signaled after cancel.