RetryAsyncContext

internal interface RetryAsyncContext(source)

Specifies the behaviour of the retry mechanism in an asynchronous context.

See also

Inheritors

Functions

Link copied to clipboard
abstract suspend fun onError(throwable: Throwable): Boolean

Handles an error that occurred during the asynchronous operation execution. Such handling may include deciding whether to retry the operation or ignore the error and complete the operation. This method might propagate the error if retrying is no longer possible (e.g., the maximum number of attempts was reached), and the caller did not specify a custom error handler.

Link copied to clipboard
abstract suspend fun onResult(result: Any?): Boolean

Determines whether a retry should be attempted based on the result of the asynchronous operation.

Link copied to clipboard
abstract suspend fun onRetry()

Initiates a retry attempt by applying the delay strategy.

Link copied to clipboard
abstract suspend fun onSuccess()

Handles the successful completion of the asynchronous operation. Even if the operation is completed without retrying once, this method is still called.