这就是我正在做的事情。当我这样做时,redis-py 会爆炸。
Python 2.7.3 (default, Aug 1 2012, 05:16:07)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import redis
>>> p = redis.ConnectionPool()
>>> r = redis.Redis(connection_pool=p)
>>> p.release(r)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/redis/connection.py", line 355, in release
if connection.pid == self.pid:
AttributeError: 'Redis' object has no attribute 'pid'
>>>