kfrancis / chargify-dot-net

MIT License
20 stars 49 forks source link

Expose async methods #1

Closed angularsen closed 8 years ago

angularsen commented 9 years ago

Same request as for the API v2 SDK: https://github.com/kfrancis/Chargify2/issues/3

The current library only exposes synchronous methods, meaning the web server is forced to keep a CPU thread twiddling its thumbs while waiting for the Chargify response. Since the thread pool is a limited resource, enough traffic to long running synchronous tasks like these can cause a severe bottleneck.

I recommend refactoring to .NET 4.5 async methods (or .NET 4 with microsoft.bcl.async nuget) so they are async by default and can be called synchronously by .Wait or .Result properties if so desired.

kfrancis commented 8 years ago

I've started an async version of the library that's structured better. I'll leave this for that project.