Retry Predicate
Represents a retry predicate that determines whether a block of code should be retried based on the result of its execution and the current retry count.
The shouldRetry method must be implemented to specify the retry condition.
In addition to shouldRetry, this interface provides default implementations for boolean logic operations, allowing for the creation of complex retry conditions by combining multiple retry predicates.
Usage:
val alwaysRetry = object : RetryPredicate {
override fun shouldRetry(result: Result<Any?>, retryCount: Int) = true
}
Since
1.0.0
Properties
Converts a RetryPredicate to a RetryPolicy with a DelayStrategy of noDelay
Functions
Combines this predicate with another using logical AND (conjunction).
Combines this predicate with another using logical NAND.
Combines this predicate with another using logical NOR.
Negates the retry condition, inverting the result of shouldRetry.
Combines this predicate with another using logical OR (disjunction).
Called by RetryPolicy.retry, determines whether a retry should be performed based on the result of execution and the retryCount.
Combines a RetryPredicate with a DelayStrategy to create a RetryPolicy.
Combines this predicate with another using logical XNOR.
Combines this predicate with another using logical XOR (exclusive OR).