当我将Lua脚本注册到redis客户端时:
script = redis_client.register_script(lua_string)
Run Code Online (Sandbox Code Playgroud)
然后使用默认客户端运行脚本:
script(keys, args)
Run Code Online (Sandbox Code Playgroud)
这会自动在内部使用evalsha还是每次都将整个脚本发送到服务器?
是.这是(删节)源代码:
class Script(object):
def __call__(self, keys=[], args=[], client=None):
if isinstance(client, BasePipeline):
# Make sure the pipeline can register the script before executing.
client.scripts.add(self)
return client.evalsha(self.sha, len(keys), *args)
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
353 次 |
| 最近记录: |