Closed timfitabase closed 3 years ago
How will the Http handler keep track of the number of current connections?
I didn't realise there was a property on HttpClientHandler which could manage this for you. Just in case anyone else stumbles across this issue - https://docs.microsoft.com/en-us/dotnet/api/system.net.http.httpclienthandler.maxconnectionsperserver?view=net-5.0
👍
There needs to be a way to limit concurrent connections to the Fitbit API to prevent resource exhaustion during times of high throughput. Before .NET Core, this was done using
ServicePointManager
in the calling code when usingFitbitClient.CreatePipeline
to create a reusableHttpClient
instance.But
ServicePointManager
does not work with .Net Core. The best way to approach this would be to have an optional parameter onFitbitClient.CreatePipeline()
that gets used to populateMaxConnectionsPerServer
onFitbitHttpMessageHandler.InnerHandler
.