Calculates the delay for a given attempt number.
Duration delayForAttempt(int attempt) { final delay = initialDelay * (backoffMultiplier * attempt); return delay > maxDelay ? maxDelay : delay; }