Configuration
rustac.store.ClientConfig
Bases: TypedDict
HTTP client configuration.
For timeout values (connect_timeout
, http2_keep_alive_timeout
,
pool_idle_timeout
, and timeout
), values can either be Python timedelta
objects, or they can be "human-readable duration strings".
The human-readable duration string is a concatenation of time spans. Where each time span is an integer number and a suffix. Supported suffixes:
nsec
,ns
-- nanosecondsusec
,us
-- microsecondsmsec
,ms
-- millisecondsseconds
,second
,sec
,s
minutes
,minute
,min
,m
hours
,hour
,hr
,h
days
,day
,d
weeks
,week
,w
months
,month
,M
-- defined as 30.44 daysyears
,year
,y
-- defined as 365.25 days
For example:
"2h 37min"
"32ms"
allow_invalid_certificates
instance-attribute
Skip certificate validation on https connections.
Warning
You should think very carefully before using this method. If invalid certificates are trusted, any certificate for any site will be trusted for use. This includes expired certificates. This introduces significant vulnerabilities, and should only be used as a last resort or for testing
connect_timeout
instance-attribute
Timeout for only the connect phase of a Client
http2_keep_alive_interval
instance-attribute
Interval for HTTP2 Ping frames should be sent to keep a connection alive.
http2_keep_alive_timeout
instance-attribute
Timeout for receiving an acknowledgement of the keep-alive ping.
http2_keep_alive_while_idle
instance-attribute
Enable HTTP2 keep alive pings for idle connections
pool_idle_timeout
instance-attribute
The pool max idle timeout.
This is the length of time an idle connection will be kept alive.
pool_max_idle_per_host
instance-attribute
Maximum number of idle connections per host.
timeout
instance-attribute
Request timeout.
The timeout is applied from when the request starts connecting until the response body has finished.
rustac.store.BackoffConfig
Bases: TypedDict
Exponential backoff with jitter.
See https://aws.amazon.com/blogs/architecture/exponential-backoff-and-jitter/
init_backoff
instance-attribute
The initial backoff duration.
Defaults to 100 milliseconds.
rustac.store.RetryConfig
Bases: TypedDict
The configuration for how to respond to request errors.
The following categories of error will be retried:
- 5xx server errors
- Connection errors
- Dropped connections
- Timeouts for safe / read-only requests
Requests will be retried up to some limit, using exponential
backoff with jitter. See BackoffConfig
for
more information
backoff
instance-attribute
backoff: BackoffConfig
The backoff configuration.
Defaults to the values listed above if not provided.
max_retries
instance-attribute
The maximum number of times to retry a request
Set to 0 to disable retries.
Defaults to 10.
retry_timeout
instance-attribute
The maximum length of time from the initial request after which no further retries will be attempted
This not only bounds the length of time before a server error will be surfaced to the application, but also bounds the length of time a request's credentials must remain valid.
As requests are retried without renewing credentials or regenerating request payloads, this number should be kept below 5 minutes to avoid errors due to expired credentials and/or request payloads.
Defaults to 3 minutes.