示例#1
0
 def connect(cls):
     """
     Establish a connection to the Redis service (if none exists)
     """
     if cls._pool is None:
         df = UnixConnectionPool("/var/run/redis/redis.sock", poolsize=2, reconnect=False)
         df.addCallback(cls._connected)
         df.addErrback(cls._connection_failed)
         return df
     return cls._pool
示例#2
0
文件: r.py 项目: donalm/webtest
 def _main():
     ucp = UnixConnectionPool()
     ucp.addCallback(testdelete)
     ucp.addCallback(testset)
     #ucp.addCallback(lambda x:testget(None, x))
     ucp.addErrback(eb)
示例#3
0
 def _main():
     ucp = UnixConnectionPool()
     ucp.addCallback(testdelete)
     ucp.addCallback(testset)
     #ucp.addCallback(lambda x:testget(None, x))
     ucp.addErrback(eb)