gpt4 book ai didi

transactions - Redis 中的顺序监视调用

转载 作者:IT王子 更新时间:2023-10-29 06:11:59 24 4
gpt4 key购买 nike

这种模式合法吗?

$redis->watch('foo');
$var1 = $redis->get('foo');

$redis->watch('bar');
$var2 = $redis->get('bar');


$redis->multi();
$redis->mset(['foo' => 42, 'bar' => 9001]);
$redis->exec();

或者秒看调用取消了先看状态?

最佳答案

这个模式是合法的。来自 redis documentation

WATCH can be called multiple times. Simply all the WATCH calls will have the effects to watch for changes starting from the call, up to the moment EXEC is called. You can also send any number of keys to a single WATCH call.

关于transactions - Redis 中的顺序监视调用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20115281/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com