| Constructor and Description |
|---|
AsyncHttpClientCall() |
| Modifier and Type | Method and Description |
|---|---|
void |
cancel() |
okhttp3.Call |
clone() |
protected Request |
createRequest(@NonNull okhttp3.Request request)
Converts retrofit request to async-http-client request.
|
void |
enqueue(okhttp3.Callback responseCallback) |
okhttp3.Response |
execute() |
protected CompletableFuture<okhttp3.Response> |
executeHttpRequest() |
protected AsyncHttpClient |
getHttpClient()
Returns HTTP client.
|
protected long |
getRequestTimeoutMillis()
Returns HTTP request timeout in milliseconds, retrieved from http client configuration.
|
protected <T> T |
handleException(Throwable throwable,
okhttp3.Callback responseCallback) |
protected okhttp3.Response |
handleResponse(okhttp3.Response response,
okhttp3.Callback responseCallback) |
boolean |
isCanceled() |
boolean |
isExecuted() |
okhttp3.Request |
request() |
protected static <T> void |
runConsumer(Consumer<T> consumer,
T argument)
Safely runs specified consumer.
|
protected static <T> void |
runConsumers(Collection<Consumer<T>> consumers,
T argument)
Safely runs multiple consumers.
|
okio.Timeout |
timeout() |
protected IOException |
toIOException(@NonNull Throwable exception) |
protected static <T> void runConsumer(Consumer<T> consumer, T argument)
T - consumer type.consumer - consumer (may be null)argument - consumer argumentprotected static <T> void runConsumers(Collection<Consumer<T>> consumers, T argument)
T - consumer type.consumers - collection of consumers (may be null)argument - consumer argumentpublic okhttp3.Request request()
request in interface okhttp3.Callpublic okhttp3.Response execute()
throws IOException
execute in interface okhttp3.CallIOExceptionpublic void enqueue(okhttp3.Callback responseCallback)
enqueue in interface okhttp3.Callpublic void cancel()
cancel in interface okhttp3.Callpublic boolean isExecuted()
isExecuted in interface okhttp3.Callpublic boolean isCanceled()
isCanceled in interface okhttp3.Callpublic okio.Timeout timeout()
timeout in interface okhttp3.Callprotected long getRequestTimeoutMillis()
public okhttp3.Call clone()
protected <T> T handleException(Throwable throwable, okhttp3.Callback responseCallback)
protected okhttp3.Response handleResponse(okhttp3.Response response,
okhttp3.Callback responseCallback)
protected CompletableFuture<okhttp3.Response> executeHttpRequest()
protected AsyncHttpClient getHttpClient()
IllegalArgumentException - if httpClientSupplier returned null.protected IOException toIOException(@NonNull @NonNull Throwable exception)
protected Request createRequest(@NonNull @NonNull okhttp3.Request request)
request - retrofit requestCopyright © 2021. All rights reserved.