> Oh look, another issue. Where do I set my Durus ClientConnection in a
> SCGI app with multiple processes? Do I have to open a ClientConnection
> for every request (ugly)?
You need to open a connection for each process (or thread - since
ClientConnection is not thread safe).
I use this function in a database module (that also defines some model
classes):
def connect(address):
tls = threading.local()
try:
connection = tls.connection
except:
connection = Connection(ClientStorage(address=address))
tls.connection = connection
return connection
This will also work with multiple processes.
--
damjan | дамјан
This is my jabber ID --> damjan@bagra.net.mk
-- not my mail address, it's a Jabber ID --^ :)