public class ClientCallbackImpl extends Object implements Client.ClientCallback
| Constructor and Description |
|---|
ClientCallbackImpl(Consumer<Throwable> onError,
Function<ResponseHeaders,ResponseDecoder> factory) |
| Modifier and Type | Method and Description |
|---|---|
void |
abort(Throwable t)
Callback method invoked when the request fails for any reason.
|
void |
complete()
Called when the request completes successfully.
|
Client.ContentCallback |
headers(ResponseHeaders responseHeaders)
Callback method invoked when the HTTP response code and headers are available.
|
public ClientCallbackImpl(Consumer<Throwable> onError, Function<ResponseHeaders,ResponseDecoder> factory)
public Client.ContentCallback headers(ResponseHeaders responseHeaders)
Client.ClientCallbackThis method can only be invoked once per request.
This method will return a callback which can be used to stream the response content, if any.
Once the response content has been exhausted, Client.ClientCallback.complete() should be called to indicate as such.
Note that should should be invoked before Client.ClientCallback.complete(), but need not be invoked before
Client.ClientCallback.abort(Throwable)
headers in interface Client.ClientCallbackresponseHeaders - The response headerspublic void abort(Throwable t)
Client.ClientCallbackNo other methods should be invoked on the callback after this is called (i.e. this is a terminal operation)
abort in interface Client.ClientCallbackt - The exception which caused the request to failpublic void complete()
Client.ClientCallbackNo other methods should be invoked on the callback after this is called (i.e. this is a terminal operation)
complete in interface Client.ClientCallbackCopyright © 2018. All rights reserved.