Page 74 - Python rat la co ban
P. 74
import redis
r = redis.StrictRedis(...)
r.set('foo', 'bar')
pipe = r.pipeline()
pipe.set('a', 1)
pipe.set('b', 2)
pipe.set('c', 3)
pipe.get('foo')
pipe.execute()
Sau khi gọi phương thức execute() thì sẽ trả về List tương
ứng với các kết quả của từng lệnh. Ví dụ kết quả từ đoạn
code trên:
[True, True, True, 'bar']