attempts
Returns a RetryPredicate that determines if a retry should be performed based on the number of attempts made. It will allow retries as long as the retry count is less than the specified number (n) minus one.
Return
a RetryPredicate that allows retries until the retry count reaches n-1.
Since
1.0.0
Parameters
n
the maximum number of attempts to allow (including the initial attempt). Must be greater than 0.
Throws
if n is not greater than 0.
Extension property that converts an Int to a RetryPredicate, which allows retries until the retry count reaches this integer minus one.
Usage:
val predicate = 3.attempts
Content copied to clipboard
Since
1.0.0