spopsadd.lua

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