Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add HttpClientFactory Capability to AvaTaxClient #148

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

ch53k
Copy link

@ch53k ch53k commented Jan 21, 2021

In .Net Core and higher using the HttpClientFactory is the preferred method for managing HTTP Clients. https://docs.microsoft.com/en-us/aspnet/core/fundamentals/http-requests?view=aspnetcore-5.0#typed-clients

The PR includes 2 new public constructors that added the HttpClient parameter. An additional private parameterless constructor to initialize the static HttpClient, if one of the new HttpClient parameter constructors is not used.

@jusbuc2k
Copy link

Any chance we can get the conflicts resolved and this PR merged? I'm concerned about using this in a SaaS deployed environment with thousands of customers because with using "new HttpClient()" for every request in a backend API this could easily exhaust the socket pool in our environment.

I would be happy to do another PR that simply allows the HttpClient to be injected if that would help. We would prefer not to fork the code and maintain it ourselves.

@ch53k
Copy link
Author

ch53k commented Jul 29, 2021

@jusbuc2k I resolved the conflicts this morning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants