예제 #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);
        }
예제 #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))));
        }
예제 #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)));
        }
예제 #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);
        }
예제 #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)));
        }
예제 #6
0
        public string RPop(string key)
        {
            RedisNativeClient client = this.pool.GetRedisClient(key);

            return((client == null) ? null : UTF8String.ToString(client.RPop(key)));
        }
예제 #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)));
        }
예제 #8
0
        public string RemoveEndFromList(string listId)
        {
            RedisNativeClient client = this.pool.GetRedisClient(listId);

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