コード例 #1
0
        protected virtual TypedRedisValue Rpush(RedisClient client, RedisRequest request)
        {
            var  key    = request.GetKey(1);
            long length = -1;

            for (int i = 2; i < request.Count; i++)
            {
                length = Rpush(client.Database, key, request.GetValue(i));
            }
            return(TypedRedisValue.Integer(length));
        }
コード例 #2
0
        protected virtual TypedRedisValue Srem(RedisClient client, RedisRequest request)
        {
            int removed = 0;
            var key     = request.GetKey(1);

            for (int i = 2; i < request.Count; i++)
            {
                if (Srem(client.Database, key, request.GetValue(i)))
                {
                    removed++;
                }
            }
            return(TypedRedisValue.Integer(removed));
        }
コード例 #3
0
 protected virtual TypedRedisValue Sismember(RedisClient client, RedisRequest request)
 => Sismember(client.Database, request.GetKey(1), request.GetValue(2)) ? TypedRedisValue.One : TypedRedisValue.Zero;