AttemptResult

data class AttemptResult<R>(val attemptNumber: Int, val result: Result<R>, val duration: Duration)(source)

Result of a single attempt in a retry operation.

Type Parameters

R

The return type of the operation

Constructors

Link copied to clipboard
constructor(attemptNumber: Int, result: Result<R>, duration: Duration)

Properties

Link copied to clipboard

The attempt number (1-based)

Link copied to clipboard

Time taken for this attempt

Link copied to clipboard

Whether this attempt failed.

Link copied to clipboard

Whether this attempt succeeded.

Link copied to clipboard

The result of this attempt

Functions

Link copied to clipboard

Returns the failure exception or null if the attempt succeeded.

Link copied to clipboard
fun getOrNull(): R?

Returns the successful result or null if the attempt failed.