RetryResult

data class RetryResult<R>(val finalResult: Result<R>, val attempts: List<AttemptResult<R>>, val totalDuration: Duration)(source)

Result of a retry operation with history.

Type Parameters

R

The return type of the operation

Constructors

Link copied to clipboard
constructor(finalResult: Result<R>, attempts: List<AttemptResult<R>>, totalDuration: Duration)

Properties

Link copied to clipboard

Total number of attempts made.

Link copied to clipboard

List of all attempts made

Link copied to clipboard

The final result (success or failure)

Link copied to clipboard

Whether the retry operation failed.

Link copied to clipboard

Whether the retry operation succeeded.

Link copied to clipboard

Total time spent on all attempts

Functions

Link copied to clipboard

Returns the failure exception or null if the operation succeeded.

Link copied to clipboard
fun getOrNull(): R?

Returns the successful result or null if the operation failed.

Link copied to clipboard
fun getOrThrow(): R

Returns the successful result or throws the failure exception.