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
def _main(): ucp = UnixConnectionPool() ucp.addCallback(testdelete) ucp.addCallback(testset) #ucp.addCallback(lambda x:testget(None, x)) ucp.addErrback(eb)