redis 的管道操作

afanti 2019-12-06

#-*- coding: utf8 -*-

import redis

pool = redis.ConnectionPool()

r = redis.Redis(connection_pool=pool)

# 支持事务
pipe = r.pipeline(transaction=True)
pipe.multi()
pipe.set("user", "egon")
pipe.set("role", "sb")

pipe.execute()

相关推荐