Package-level declarations

Types

Link copied to clipboard

Represents a predicate function that produces a Boolean for a given Result, retry count Int, and elapsed time Duration.

Link copied to clipboard
interface RetryPredicate

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.

Properties

Link copied to clipboard

Extension property that converts an Int to a RetryPredicate, which allows retries until the retry count reaches this integer minus one.

Link copied to clipboard

A RetryPredicate implementation that checks whether the result is a failure.

Link copied to clipboard

A RetryPredicate implementation that checks whether the result is null and not an error.

Link copied to clipboard

Extension property on Duration to get a RetryPredicate that limits the retry time to this duration.

Link copied to clipboard

A RetryPredicate implementation that checks whether the result is null or an error.

Functions

Link copied to clipboard

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.

Link copied to clipboard
inline fun on(crossinline predicate: PredicateFunction): RetryPredicate

Returns a RetryPredicate that mirrors the result of the given predicate. It will allow retries when the predicate returns false.

Link copied to clipboard
inline fun <T> onResultType(): RetryPredicate

Returns a RetryPredicate that checks if the result is of the specified type T.

Link copied to clipboard

Returns a RetryPredicate that limits the retry time to the specified duration. The predicate will allow retries as long as the elapsed time since the first attempt is less than duration.

Link copied to clipboard
inline fun until(crossinline predicate: PredicateFunction): RetryPredicate

Returns a RetryPredicate that negates the result of the given predicate lambda function. It will allow retries until the predicate returns true.

Link copied to clipboard

Returns a RetryPredicate that checks if the result is not of the specified type T.