avivbiton / BlizzardApiReader

.Net Core library to handle Blizzard public APIs
MIT License
35 stars 36 forks source link

Fixed connection lifetime in HttpClients by using SocketsHttpHandler #46

Closed oliverkovac closed 5 years ago

oliverkovac commented 5 years ago

I've found out that there is an more elegant solution to the problem in .NET Core 2.1 which we're using, so I've changed it to use that. HttpClients in the ApiWebClient should now close the connection after a minute so following request would open a new one along with a new DNS lookup, which is just what we need.

redmars27 commented 5 years ago

Have you also look on implementing microservices best practices? Like for example a circuit breaker? Also, I would like to see if I can implement dependency injection for the HttpClient, as it will help on the testing part

oliverkovac commented 5 years ago

Nope, I'm quite a beginner in this field, so I've just modified what the old one did to reuse connections, without really adding any layer of abstraction over it, that's too much to ask of my networking and microservices knowledge and I'd just end up botching it anyway. I'll check out the circuit breaker.

redmars27 commented 5 years ago

I am learning too. 😆