8 ms·
Sounds like they need to use a lua function to ensure that pop and push operation remains atomic within the redis instance? For example: spopsadd local src_li
by taf2 4y ago
Sounds like they need to use a lua function to ensure that pop and push operation remains atomic within the redis instance?
For example: spopsadd
local src_list = ARGV[1]
local dst_list = ARGV[2]
local value = redis.call('spop', src_list)
if value then -- avoid pushing nils
redis.call('sadd', dst_list, value)
end
return value