suds-community / suds

Suds is a lightweight SOAP python client for consuming Web Services. A community fork of the jurko fork.
https://suds.readthedocs.io/
GNU Lesser General Public License v3.0
172 stars 54 forks source link

Async requests #53

Closed samueldominguez closed 3 years ago

samueldominguez commented 3 years ago

Can N requests be queued and sent asynchronously? Haven't found any references in the documentation. Best alternative?

phillbaker commented 3 years ago

Hi @samueldominguez, not at this time.

What's the problem you're trying to solve? It's not clear to me that queuing requests is a generic approach as requests may mutate data that invalidate later calls.

samueldominguez commented 3 years ago

My idea was to send a request that may be executed asynchronously, and perhaps setting a limit on the number of requests to be executing at the same time, as a form of rate limiting. Then perhaps specify a callback to handle the results. So, if you specified 10 simultaneous requests max, once any is complete and there are more in the queue, those will be executed and so on. Maybe you can set no limit and just try to run all of them ASAP.

I fixed this by using threading though.

phillbaker commented 3 years ago

Thanks @samueldominguez I'm going to close out this issue as it seems like you found a working approach.

If you wouldn't mind posting a simple example of your code so that others could reference it, I think users of this package would benefit!