R - result typeF - failure type@FunctionalInterface public interface DelayFunction<R,F extends Throwable>
Policy execution attempts.| Modifier and Type | Method and Description |
|---|---|
Duration |
computeDelay(R result,
F failure,
ExecutionContext context)
Returns the amount of delay before the next
Policy execution attempt based on the result
or failure of the last attempt and the execution context (executions so far). |
Duration computeDelay(R result, F failure, ExecutionContext context)
Policy execution attempt based on the result
or failure of the last attempt and the execution context (executions so far). This method must complete quickly,
not have side-effects, and always return the same result for the same input. Unchecked exceptions thrown by this
method will not be treated as part of the fail-safe processing and will instead abort that
processing.
Notes:
result - the result, if any, of the last attemptfailure - the Throwable thrown, if any, during the last attemptcontext - the ExecutionContext that describes executions so far. May be null if the execution
failure was manually recorded outside of a Failsafe execution.Copyright © 2021. All rights reserved.