Retry Module
Retry combinators with exponential backoff and fixed delay strategies.
Functions and values
| Function or value |
Description
|
||
Full Usage:
Retry.tryWithBackoff maxRetries baseDelay ct f
Parameters:
int
-
Maximum number of retry attempts.
baseDelay : TimeSpan
-
Initial delay; doubles after each failed attempt.
ct : CancellationToken
-
Cancellation token to abort the retry loop.
f : unit -> Task<'T>
-
Async factory to invoke on each attempt.
Returns: Task<Result<'T, exn>>
Ok(value) on success, Error(exn) after all retries fail.
|
Retries f with exponential backoff, returning
|
||
Full Usage:
Retry.withBackoff maxRetries baseDelay ct f
Parameters:
int
-
Maximum number of retry attempts.
baseDelay : TimeSpan
-
Initial delay; doubles after each failed attempt.
ct : CancellationToken
-
Cancellation token to abort the retry loop.
f : unit -> Task<'T>
-
Async factory to invoke on each attempt.
Returns: Task<'T>
|
Retries f up to maxRetries times with exponential backoff. Base delay doubles each attempt. Throws the last exception if all attempts fail.
Example
|
||
Full Usage:
Retry.withDelay maxRetries delay ct f
Parameters:
int
delay : TimeSpan
ct : CancellationToken
f : unit -> Task<'T>
Returns: Task<'T>
|
Retries f with a fixed delay between attempts. Maximum number of retry attempts. Fixed delay between each attempt. Cancellation token to abort the retry loop. Async factory to invoke on each attempt.
|
TDesu.FSharp