public static interface HttpLifecycleObserver.HttpExchangeObserver
An exchange is represented by a request and a response.
Both can be observed independently and may publish their events concurrently because connections are full-duplex.
The terminal event for the exchange is signaled only when nested observers signal
terminal events. Cancellation is the best effort, more events may be signaled after cancel.
| Modifier and Type | Method and Description |
|---|---|
void |
onConnectionSelected(ConnectionInfo info)
Callback when a connection is selected for this exchange execution.
|
void |
onExchangeFinally()
Callback when the exchange completes.
|
HttpLifecycleObserver.HttpRequestObserver |
onRequest(HttpRequestMetaData requestMetaData)
Callback when a request starts.
|
HttpLifecycleObserver.HttpResponseObserver |
onResponse(HttpResponseMetaData responseMetaData)
Callback when a response meta-data was observed.
|
void |
onResponseCancel()
Callback if the response meta-data was cancelled.
|
void |
onResponseError(Throwable cause)
Callback if the response meta-data was not received due to an error.
|
void onConnectionSelected(ConnectionInfo info)
info - ConnectionInfo of the selected connectionHttpLifecycleObserver.HttpRequestObserver onRequest(HttpRequestMetaData requestMetaData)
requestMetaData - The corresponding HttpRequestMetaDataHttpLifecycleObserver.HttpRequestObserver that provides visibility into request eventsHttpLifecycleObserver.HttpResponseObserver onResponse(HttpResponseMetaData responseMetaData)
responseMetaData - the corresponding HttpResponseMetaDataHttpLifecycleObserver.HttpResponseObserver that provides visibility into response eventsvoid onResponseError(Throwable cause)
cause - the cause of a response meta-data failurevoid onResponseCancel()
Cancellation is the best effort, more events may be signaled after cancel.
void onExchangeFinally()
This is the final callback that is invoked after HttpLifecycleObserver.HttpRequestObserver terminate and either
HttpLifecycleObserver.HttpResponseObserver terminate or onResponseError(Throwable)/onResponseCancel()
method is invoked.