-
How do I change settings on the hyper client used by the SDK, such as pool idle timeout or other HTTP settings? |
Beta Was this translation helpful? Give feedback.
Answered by
jdisanti
Feb 15, 2022
Replies: 1 comment
-
As of version 0.6.0 of the SDK, the hyper client settings can be customized by manually creating a connector with // Load credentials from the environment as usual
let shared_config = aws_config::load_from_env().await;
// Create a connector with the underlying hyper client customized
let conn = aws_smithy_client::hyper_ext::Builder::default()
.hyper_builder({
let mut builder = hyper::Client::builder();
// Customize the hyper client here with the builder methods on
// https://docs.rs/hyper/0.14.17/hyper/client/struct.Builder.html
// For example:
// builder.pool_idle_timeout(None);
builder
})
// Use the default https connector
.build(aws_smithy_client::conns::https());
// Create the AWS service client with the shared config and the customized connector
let client = Client::from_conf_conn((&shared_config).into(), conn); |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Velfi
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As of version 0.6.0 of the SDK, the hyper client settings can be customized by manually creating a connector with
aws_smithy_client::hyper_ext::Builder
: