cacheClientDB.GetClient().Custom("SET","name","陈子涵");
性能非常好,没有锁,不好性能,而且是原子性 var lua = @"local count = redis.call('SISMEMBER',KEYS[1],ARGV[1]) if(tonumber(count)>=0) then redis.call('SREM',KEYS[1],ARGV[1]) else end redis.call('SADD',KEYS[2],ARGV[1]) ";
调用 Console.WriteLine(client.ExecLuaAsString(lua, keys: new string[] { "keys1", "keys2" }, args: new string[] { "2" }));