Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Suds for SOAP in python, are suds.client.Client objects thread safe?

I'm using Suds to access a SOAP web service from python. If I have multiple threading.Thread threads of execution, can each of them safely access the same suds.client.Client instance concurrently, or must I create separate Client objects for each thread?

like image 710
kdt Avatar asked Nov 05 '22 12:11

kdt


1 Answers

As far as I know they are NOT thread safe. You could safely use the same client object so long as you are using a queue or thread pool. That way when one thread is done with the client, the next one can use it.

For network-based events however, you should probably ask yourself which is better. Threading or asynchronous network programming? There was recently a patch proposed to SUDS to enable support for asynch sockets for use with event-based packages such as Twisted, greenlets, etc.

like image 79
jathanism Avatar answered Nov 12 '22 18:11

jathanism