public static interface HttpLifecycleObserver.HttpRequestObserver
The request is considered complete when one of the terminal events is invoked. It's guaranteed only one terminal event will be invoked per request.
| Modifier and Type | Method and Description |
|---|---|
void |
onRequestCancel()
Callback if the request is cancelled.
|
void |
onRequestComplete()
Callback if the request completes successfully.
|
void |
onRequestData(Buffer data)
Callback when the request payload body data chunk was observed.
|
default void |
onRequestDataRequested(long n)
Callback when subscriber requests
n items of the request payload body. |
void |
onRequestError(Throwable cause)
Callback if the request fails with an error.
|
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. Helps to track when items are requested and when they are
delivered.
n - number of requested itemsvoid onRequestData(Buffer data)
May be invoked multiple times if the payload body is split into multiple chunks.
data - the request payload body data chunkvoid onRequestTrailers(HttpHeaders trailers)
trailers - trailers of the requestvoid onRequestComplete()
This is one of the possible terminal events.
void onRequestError(Throwable cause)
This is one of the possible terminal events.
cause - Throwable that fails this requestvoid onRequestCancel()
This is one of the possible terminal events. Cancellation is the best effort, more events may be signaled after cancel.