Example #1
0
        public static string[] ToStringArray(byte[][] bytes)
        {
            var strings = new string[bytes.GetLength(0)];

            for (var i = 0; i < bytes.Length; i++)
            {
                strings[i] = (bytes[i] != null) ? UTF8String.ToString(bytes[i]) : null;
            }
            return(strings);
        }
Example #2
0
        public string GetValueFromHash(string hashId, string key)
        {
            if (!this.IsValidField(key))
            {
                return(null);
            }

            RedisNativeClient client = this.pool.GetRedisClient(hashId);

            return((client == null) ? null : UTF8String.ToString(client.HGet(hashId, UTF8String.ToBytes(key))));
        }
Example #3
0
        public string RPopLPush(string key, string value)
        {
            if (!this.IsValidValue(value))
            {
                return(null);
            }

            RedisNativeClient client = this.pool.GetRedisClient(key);

            return((client == null) ? null : UTF8String.ToString(client.RPopLPush(key, value)));
        }
Example #4
0
        public static List <string> ToStringList(byte[][] bytes)
        {
            if (bytes == null)
            {
                return(null);
            }

            var results = new List <string>();

            foreach (var item in bytes)
            {
                results.Add(UTF8String.ToString(item));
            }
            return(results);
        }
Example #5
0
        public string BRPopLPush(string fromKey, string toKey, int timeOutSecs)
        {
            RedisNativeClient client = this.pool.GetRedisClient(fromKey, toKey);

            return((client == null) ? null : UTF8String.ToString(client.BRPopLPush(fromKey, toKey, timeOutSecs)));
        }
Example #6
0
        public string RPop(string key)
        {
            RedisNativeClient client = this.pool.GetRedisClient(key);

            return((client == null) ? null : UTF8String.ToString(client.RPop(key)));
        }
Example #7
0
        //------------------------------------------------------------------
        // LIST

        public string LIndex(string key, int index)
        {
            RedisNativeClient client = this.pool.GetRedisClient(key);

            return((client == null) ? null : UTF8String.ToString(client.LIndex(key, index)));
        }
Example #8
0
        public string RemoveEndFromList(string listId)
        {
            RedisNativeClient client = this.pool.GetRedisClient(listId);

            return((client == null) ? null : UTF8String.ToString(client.RPop(listId)));
        }