-
Notifications
You must be signed in to change notification settings - Fork 22
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
Update RestSharp to v107 and follow recommended usage #46
Comments
Please provide option to configure HttpClient in merchant’s source code and inject HttpClient into CyberSource Client SDK. WHY: HttpClient has problems. Create an instance for every request and you will run into socket exhaustion. Make it a singleton and it will not respect DNS changes.
Please see that RestSharp’s contributors have already noticed that RestSharp’s recommendation to always create a singleton RestClient https://restsharp.dev/v107/#restclient-lifecycle doesn’t work for all use cases. There is active issue on RestSharp GitHub restsharp/RestSharp#1791 which mentions: “The biggest problem I foresee with the way v107 is currently implemented is while it does fix the issued with connection exhaustion, it does not fix the issues with DNS resolution problems. So anyone using RestSharp v107 and singleton instances, or anyone relying on a library that does the same (like EasyPost if they accept my patches) can potentially run into DNS related problems if their application needs to respect DNS changes.” and last comment restsharp/RestSharp#1791 (comment) is also what we ask for. |
With the new version implemented, RestSharp solves a couple of issues:
Upgrade RestSharp to to v107 https://restsharp.dev/v107/#restsharp-v107
and follow best practices https://restsharp.dev/v107/#recommended-usage
https://code-maze.com/httpclient-vs-restsharp/
The text was updated successfully, but these errors were encountered: