[Twisted-Python] getting "connection per thread" behaviour

Chris Withers chris at simplistix.co.uk
Thu Apr 29 11:48:55 EDT 2010

Hi All,

I was asking about this on irc but had to leave in a hurry so thought 
I'd mail here...

So, I have a pool of wsgi threads being run by Twisted's wsgi server 
that want to send stomp messages. The stomp client is Twisted-based 
I want to have as few stomp connections as possible, maxing out at one 
per thread.

Bonus complications:

- each wsgi thread has a logical transaction, that needs to marry up 
with the stomp logical transaction, so I can't just have one stomp 
connection per thread

- I don't know how much overhead there is in creating the stomp 
connection, so I'd like to open as few as possible but keep them open 
and re-use them across wsgi requests.

I found:


Anyone know how good that is and if it's useful here?

All help gratefully received!


More information about the Twisted-Python mailing list