| Modifier and Type | Class and Description |
|---|---|
static class |
FailsafeCall.FailsafeCallBuilder |
| Modifier and Type | Method and Description |
|---|---|
void |
cancel()
Cancels the call.
|
FailsafeCall |
clone()
Returns a clone of the FailsafeCall.
|
okhttp3.Response |
execute()
Executes the call until a successful response is returned or the configured policies are exceeded.
|
CompletableFuture<okhttp3.Response> |
executeAsync()
Executes the call asynchronously until a successful result is returned or the configured policies are exceeded.
|
boolean |
isCancelled()
Returns whether the call has been cancelled.
|
boolean |
isExecuted()
Returns whether the call has been executed.
|
static FailsafeCall.FailsafeCallBuilder |
with(FailsafeExecutor<okhttp3.Response> failsafeExecutor)
Returns a FailsafeCallBuilder for the
failsafeExecutor. |
static <P extends Policy<okhttp3.Response>> |
with(P outerPolicy,
P... policies)
Returns a FailsafeCallBuilder for the
outerPolicy and policies. |
@SafeVarargs public static <P extends Policy<okhttp3.Response>> FailsafeCall.FailsafeCallBuilder with(P outerPolicy, P... policies)
outerPolicy and policies. See Failsafe.with(Policy,
Policy[]) for docs on how policy composition works.P - policy typeNullPointerException - if call or outerPolicy are nullpublic static FailsafeCall.FailsafeCallBuilder with(FailsafeExecutor<okhttp3.Response> failsafeExecutor)
failsafeExecutor.NullPointerException - if failsafeExecutor is nullpublic void cancel()
public FailsafeCall clone()
public okhttp3.Response execute()
throws IOException
close the Response which in turn will close the underlying
ResponseBody.IllegalStateException - if the call has already been executedIOException - if the request could not be executed due to cancellation, a connectivity problem, or timeoutFailsafeException - if the execution fails with a checked Exception. Throwable.getCause() can
be used to learn the underlying checked exception.public CompletableFuture<okhttp3.Response> executeAsync()
close the Response which in turn will close the
underlying ResponseBody.public boolean isCancelled()
public boolean isExecuted()
Copyright © 2022. All rights reserved.