Skip to main content

Module retry

Module retry 

Source
Expand description

A retry strategy that works with rusts native std::error::Error type.

TODO: Could make the impl of RetryableError trait into a proc-macro to auto-derive Retryable on annotated enum variants.

ⓘ
#[derive(Debug, Error)]
enum ErrorFoo {
    #[error("I am retryable")]
    #[retryable]
    Retryable,
    #[error("Nested errors are retryable")]
    #[retryable(inherit)]
    NestedRetryable(AnotherErrorWithRetryableVariants),
    #[error("Always fail")]
    NotRetryable
}

Structs§

ExponentialBackoff
ExponentialBackoffBuilder
NotSpecialized
Retry
Options to specify how to retry a function
RetryBuilder
Builder for Retry

Traits§

RetryableError
Specifies which errors are retryable. All Errors are not retryable by-default.
Strategy
The strategy interface

Functions§

arc_retryable_to_error
Convert an Arc<[RetryableError]> to a Standard Library Arc<Error>
with_retry_deadline
Run future so that every rate-limit wait of [retry_async!] inside it ends by deadline. A wait that would pass it returns the rejection at once, so a caller that times out at deadline still sees the delay. A nested scope keeps the earlier deadline.

Type Aliases§

BoxedRetry