retryWithBackoff

suspend fun <T> retryWithBackoff(policy: RetryPolicy = RetryPolicy.DEFAULT, random: Random = Random.Default, block: suspend (attempt: Int) -> T): T

Runs block, retrying on failure with exponential backoff and optional jitter.

Attempt indices passed to block are 1-based (1 = first try). CancellationException is never retried.