net/http: mechanism to dynamically change MaxIdleConnsPerHost? #14984
Labels
FeatureRequest
Issues asking for a new feature that does not need a proposal.
Milestone
Please answer these questions before submitting your issue. Thanks!
go version
)?go env
)?It is not possible for clients of
http.Transport
to dynamically change MaxIdleConnsPerHost attribute. It would be great to have async.RWMutex
as an attribute ofhttp.Transport
, so this is possible.The use case is that for HTTP/1.1 Hosts, it would be nice for the client to have the possibility of adjusting max-idle connections base on usage.
The following gist shows the problem:
https://gist.github.com/go-loco/810fe53d8aee8879b8d1
Making the following changes to http.Transport would add this feature:
The text was updated successfully, but these errors were encountered: