Module backoff

Module backoff 

Source
Expand description

Exponential backoff for use with QCS.

This re-exports types from backoff and provides a default_backoff function to create a more useful default [ExpontentialBackoff].

Modules§

backoff
default
Constants for the exponential backoff policy.
exponential
future

Structs§

SystemClock
SystemClock uses the system’s clock to get the current time. This Clock should be used for real use-cases.

Enums§

Error
Error is the error value in an operation’s result.

Traits§

Clock
Clock returns the current time.
Notify
Notify is called in retry_notify in case of errors.

Functions§

default_backoff
Create a default ExponentialBackoff for use with QCS.
duration_from_io_error
Return Some if the error is one that makes sense to retry and method is one that indicates it is safe to retry.
duration_from_reqwest_error
Return Some if the error is one that makes sense to retry and method is one that indicates it is safe to retry.
duration_from_response
Return Some if the response specifies a Retry-After header or the provided backoff has another backoff to try. If None is returned, the request should not be retried.
retry
Retries this operation according to the backoff policy. backoff is reset before it is used.
retry_notify
Retries this operation according to the backoff policy. Calls notify on failed attempts (in case of transient errors). backoff is reset before it is used.
status_code_is_retry
Return true if the status code is one that could be retried.

Type Aliases§

ExponentialBackoff
Exponential backoff policy with system’s clock.
ExponentialBackoffBuilder
Builder for exponential backoff policy with system’s clock.