Esempio n. 1
0
        public static RedisInt ZRemRangeByScore(string key, double min, double max, bool exclusiveMin = false, bool exclusiveMax = false)
        {
            string min_score = RedisArgs.GetScore(min, exclusiveMin);
            string max_score = RedisArgs.GetScore(max, exclusiveMax);

            return(new RedisInt("ZREMRANGEBYSCORE", key, min_score, max_score));
        }
Esempio n. 2
0
        private string CreateMessage(string command, params object[] args)
        {
            using (new ActivityTracer("Create message"))
            {
                string[] cmd = RedisArgs.Concat(command.ToString().Split(' '), args);
                ActivityTracer.Source.TraceEvent(TraceEventType.Information, 0, "Command: {0} {1}", command, String.Join(" ", args));

                StringBuilder cmd_builder = new StringBuilder();

                cmd_builder
                .Append(MultiBulk)
                .Append(cmd.Length)
                .Append(EOL);

                foreach (var arg in cmd)
                {
                    cmd_builder
                    .Append(Bulk)
                    .Append(arg.Length)
                    .Append(EOL);
                    cmd_builder
                    .Append(arg)
                    .Append(EOL);
                }

                string cmd_protocol = cmd_builder.ToString();
                ActivityTracer.Source.TraceEvent(TraceEventType.Verbose, 0, "Unified command: {0}", cmd_protocol);
                return(cmd_protocol);
            }
        }
Esempio n. 3
0
        public static RedisInt ZCount(string key, double min, double max, bool exclusiveMin = false, bool exclusiveMax = false)
        {
            string min_score = RedisArgs.GetScore(min, exclusiveMin);
            string max_score = RedisArgs.GetScore(max, exclusiveMax);

            return(new RedisInt("ZCOUNT", key, min_score, max_score));
        }
Esempio n. 4
0
        public static RedisStrings ZRevRangeByScore(string key, double max, double min, bool withScores = false, bool exclusiveMax = false, bool exclusiveMin = false, long?offset = null, long?count = null)
        {
            string min_score = RedisArgs.GetScore(min, exclusiveMin);
            string max_score = RedisArgs.GetScore(max, exclusiveMax);

            string[] args = new[] { key, max_score, min_score };
            if (withScores)
            {
                args = RedisArgs.Concat(args, new[] { "WITHSCORES" });
            }
            if (offset.HasValue && count.HasValue)
            {
                args = RedisArgs.Concat(args, new[] { "LIMIT", offset.Value.ToString(), count.Value.ToString() });
            }

            return(new RedisStrings("ZREVRANGEBYSCORE", args));
        }
Esempio n. 5
0
 public static RedisInt RPushX(string key, params object[] values)
 {
     string[] args = RedisArgs.Concat(key, values);
     return(new RedisInt("RPUSHX", args));
 }
Esempio n. 6
0
 public static RedisInt ZRem(string key, params object[] members)
 {
     string[] args = RedisArgs.Concat(new[] { key }, members);
     return(new RedisInt("ZREM", args));
 }
Esempio n. 7
0
 public static RedisInt ZAdd(string key, params string[] memberScores)
 {
     object[] args = RedisArgs.Concat(key, memberScores);
     return(new RedisInt("ZADD", args));
 }
Esempio n. 8
0
 public static RedisInt ZAdd <TScore, TMember>(string key, params Tuple <TScore, TMember>[] memberScores)
 {
     object[] args = RedisArgs.Concat(key, RedisArgs.GetTupleArgs(memberScores));
     return(new RedisInt("ZADD", args));
 }
Esempio n. 9
0
 public static RedisIntNull Object(RedisObjectSubCommand subCommand, params string[] arguments)
 {
     object[] args = RedisArgs.Concat(subCommand.ToString(), arguments);
     return(new RedisIntNull("OBJECT", args));
 }
Esempio n. 10
0
 public static RedisStatus MSet(params Tuple <string, string>[] keyValues)
 {
     object[] args = RedisArgs.GetTupleArgs(keyValues);
     return(new RedisStatus("MSET", args));
 }
Esempio n. 11
0
 public static RedisInt BitOp(RedisBitOp operation, string destKey, params string[] keys)
 {
     string[] args = RedisArgs.Concat(new[] { operation.ToString().ToUpper(), destKey }, keys);
     return(new RedisInt("BITOP", args));
 }
Esempio n. 12
0
 public static RedisValue BRPop(int timeout, params string[] keys)
 {
     string[] args = RedisArgs.Concat(keys, new object[] { timeout });
     return(new RedisValue("BRPOP", args));
 }
Esempio n. 13
0
 public static RedisInt LPush(string key, params object[] values)
 {
     string[] args = RedisArgs.Concat(new[] { key }, values);
     return(new RedisInt("LPUSH", args));
 }
Esempio n. 14
0
 public static RedisTuple BLPopWithKey(int timeout, params string[] keys)
 {
     string[] args = RedisArgs.Concat(keys, new object[] { timeout });
     return(new RedisTuple("BLPOP", args));
 }
Esempio n. 15
0
 public static RedisStrings HMGet(string key, params string[] fields)
 {
     string[] args = RedisArgs.Concat(key, fields);
     return(new RedisStrings("HMGET", args));
 }
Esempio n. 16
0
 public static RedisInt HDel(string key, params string[] fields)
 {
     string[] args = RedisArgs.Concat(key, fields);
     return(new RedisInt("HDEL", args));
 }
Esempio n. 17
0
 public static RedisStatus PfMerge(string destKey, params string[] sourceKeys)
 {
     string[] args = RedisArgs.Concat(destKey, sourceKeys);
     return(new RedisStatus("PFMERGE", args));
 }
Esempio n. 18
0
 public static RedisInt PfAdd(string key, params object[] elements)
 {
     string[] args = RedisArgs.Concat(key, elements);
     return(new RedisInt("PFADD", args));
 }
Esempio n. 19
0
 public static RedisObject EvalSHA(string sha1, string[] keys, params string[] arguments)
 {
     string[] args = RedisArgs.Concat(new object[] { sha1, keys.Length }, keys, arguments);
     return(new RedisObject("EVALSHA", args));
 }
Esempio n. 20
0
 public static RedisInt SInterStore(string destination, params string[] keys)
 {
     object[] args = RedisArgs.Concat(destination, keys);
     return(new RedisInt("SINTERSTORE", args));
 }
Esempio n. 21
0
 public static RedisString ObjectEncoding(params string[] arguments)
 {
     string[] args = RedisArgs.Concat("ENCODING", arguments);
     return(new RedisString("OBJECT", args));
 }
Esempio n. 22
0
 public static RedisInt SRem(string key, params object[] members)
 {
     object[] args = RedisArgs.Concat(key, members);
     return(new RedisInt("SREM", args));
 }
Esempio n. 23
0
 public static RedisBool MSetNx(params Tuple <string, string>[] keyValues)
 {
     object[] args = RedisArgs.GetTupleArgs(keyValues);
     return(new RedisBool("MSETNX", args));
 }
Esempio n. 24
0
 public static RedisInt SUnionStore(string destination, params string[] keys)
 {
     string[] args = RedisArgs.Concat(destination, keys);
     return(new RedisInt("SUNIONSTORE", args));
 }