Modifier and Type | Class and Description |
---|---|
static class |
FailsafeCall.FailsafeCallBuilder<R> |
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Cancels the call.
|
FailsafeCall<R> |
clone()
Returns a clone of the FailsafeCall.
|
retrofit2.Response<R> |
execute()
Executes the call until a successful response is returned or the configured policies are exceeded.
|
CompletableFuture<retrofit2.Response<R>> |
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 <R> FailsafeCall.FailsafeCallBuilder<R> |
with(FailsafeExecutor<retrofit2.Response<R>> failsafeExecutor)
Returns a FailsafeCallBuilder for the
failsafeExecutor . |
static <R,P extends Policy<retrofit2.Response<R>>> |
with(P outerPolicy,
P... policies)
Returns a FailsafeCallBuilder for the
outerPolicy and policies . |
@SafeVarargs public static <R,P extends Policy<retrofit2.Response<R>>> FailsafeCall.FailsafeCallBuilder<R> with(P outerPolicy, P... policies)
outerPolicy
and policies
. See Failsafe.with(Policy,
Policy[])
for docs on how policy composition works.R
- result typeP
- policy typeNullPointerException
- if call
or outerPolicy
are nullpublic static <R> FailsafeCall.FailsafeCallBuilder<R> with(FailsafeExecutor<retrofit2.Response<R>> failsafeExecutor)
failsafeExecutor
.R
- result typeNullPointerException
- if failsafeExecutor
is nullpublic void cancel()
public FailsafeCall<R> clone()
public retrofit2.Response<R> execute() throws IOException
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<retrofit2.Response<R>> executeAsync()
public boolean isCancelled()
public boolean isExecuted()
Copyright © 2022. All rights reserved.