Actually this is what I've used to create per thread durus connections
and cache them:

from durus.client_storage import ClientStorage
from durus.connection import Connection
import threading

def connect(address):
    tls = threading.local()
    try:
      connection = tls.connection
    except:
      connection = Connection(ClientStorage(address=address))
      tls.connection = connection
    return connection
I'm using it here with Unix domain sockets, so I just need one
'address' parameter.
(BTW I think Durus should unify the address like it's with the Python
sockets, but that's a whole another story).


--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To post to this group, send email to pylons-discuss@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to