RetryPolicy

interface RetryPolicy

Defines a contract for implementing resilience strategies that automatically retry a failed operation.

Implementations of this interface encapsulate the logic for retrying a suspendable code block (block) based on a configured set of rules, such as the maximum number of attempts, the backoff strategy between retries, and conditions for when a retry should occur.

Inheritors

Functions

Link copied to clipboard
abstract suspend fun <T> execute(block: suspend () -> T): T

Executes block and retries on failure according to the policy configuration.