1 2 3 4 5 6
local addr = redis.call("spop", KEYS[1]) if not addr then return redis.error_reply("Nothing to SPOP") end redis.call("sadd", KEYS[2], addr) return addr