Skip to main content

pooled_http_client

Function pooled_http_client 

Source
pub fn pooled_http_client(
    max_in_flight: impl Fn() -> usize + Send + Sync + 'static,
    metrics: HttpPoolMetrics,
) -> impl HttpClient
Expand description

Returns an HTTP client for use with the AWS SDK, like http_client, that opens more connections to a host as requests to it pile up.

Use it for servers that speak HTTP/2, like GCS. Over HTTP/2, http_client sends every request to a host over one connection, which caps throughput.

A request opens a new connection once every connection has max_in_flight() requests in flight, read per request. 0 counts as 1.