R
- result typepublic interface Call<R>
cancelCallback
that is registered. Useful for integrating with libraries
that support cancellation.
To perform cancellable async executions, use the FailsafeExecutor
async methods.
Modifier and Type | Method and Description |
---|---|
boolean |
cancel(boolean mayInterruptIfRunning)
Cancels a synchronous execution and calls the most recent
cancelCallback that was registered. |
R |
execute()
Executes the call until a successful result is returned or the configured policies are exceeded.
|
boolean |
isCancelled()
Returns whether the call has been cancelled.
|
R execute()
FailsafeException
- if the execution fails with a checked Exception. Throwable.getCause()
can
be used to learn the underlying checked exception.boolean cancel(boolean mayInterruptIfRunning)
cancelCallback
that was registered. The execution is still allowed to complete and return a result. In addition to
using a cancelCallback
, executions can cooperate with
cancellation by checking ExecutionContext.isCancelled()
.mayInterruptIfRunning
- whether the execution should be interruptedfalse
if the execution was already cancelled or
completed.boolean isCancelled()
Copyright © 2022. All rights reserved.