-
Notifications
You must be signed in to change notification settings - Fork 17
Description
Looking through the SDK code, it appears that SignNowContext (and indeed anything that inherits WebClientBase) ends up instantiating an HttpClient each time that object is instantiated. This can lead to socket exhaustion and performance issues if used incorrectly (see Issues with the original HttpClient class available in .NET).
Fortunately, it is fairly simple to support integration with HttpClientFactory (without breaking .Net4.5 compatability). There's a couple of ways that could happen in this project:
- Make
SignNowClientpublic, and make theOAuth2ServiceandSignNowContextconstructors acceptingSignNowClientpublic - Add constructors accepting
HttpClienttoOAuth2ServiceandSignNowContext, and instantiate aSignNowClientwithin these classes.
Personally, I think the former would be the simplest approach and I would be happy to work on a PR to implement this. It might be worth noting that this also has other benefits aside from performance including the ability to use middleware like Polly as well as improved testability.