Skip to main content

send_with_retry

Function send_with_retry 

Source
pub async fn send_with_retry<F, Fut, T>(
    f: F,
    opts: &RetryOptions,
) -> ApiResult<T>
where F: Fn() -> Fut, Fut: Future<Output = ApiResult<T>>,
Expand description

Retry a future-producing closure on ApiError::RateLimit.

If the API returns a ratelimit-reset header, that value (in seconds) is used as the sleep duration. Otherwise, opts.base_delay_ms is used.