square-python-sdk
square-python-sdk copied to clipboard
Async
Hi there!
I was wondering whether or not this library will support async anytime soon
Hello @thomaspaulgrey! Would you be able to provide any details about your use case for async support? This would help us with prioritizing feature work.
I'm using the Squrae SDK in my backend and async requests makes it very easy to perform other tasks while waiting for the response to a request to Square. If the "other tasks" are also io/network bound (e.g. more requests to Square 😄), I'm likely also running them in an async way, such that I can combine the waiting time (as such, the time I wait is approx. equal to the time the slowest task takes). This is naturally much faster than doing all the waiting sequentially.
And yes, much of that could be done using threads, but there are various disadvantages (especially for i/o bound operations) to using threading over asyncio. See e.g. this great comment.
See also these fastapi docs providing a detailed, yet simple and intuitive motivation for using async requests.
Hi there, I'm sorry to report that at this time we will not be adding 'async' functionality to the SDK. I will leave this issue open as a data point for when we go to make feature improvements to our SDKs though. For now it will be marked as Won't fix
- thank you for raising this question with us!