3
最近我一直在玩Redis,想知道如何一次完成多個鍵的觀看。 下面的東西會是原子嗎?是否有可能在Python中觀察多個Redis KEYs?
以下代碼使用redis-py;
while True:
try:
pipe.watch(key)
pipe.watch(another_key)
pipe.multi()
pipe.set(key, value)
pipe.set(another_key, another_value)
pipe.execute()
break
except redis.WatchError:
continue
finally:
pipe.reset()
大聲笑我已經通過文件至少5次左右。有趣的事情沒有注意到這些參數。 – xzvkm 2013-03-20 23:11:12