Пример #1
0
        public long HSetNx(string key, string field, string value)
        {
            RedisNativeClient client = this.pool.GetRedisClient(key);

            return((client == null) ? 0L : client.HSetNX(key, UTF8String.ToBytes(field), UTF8String.ToBytes(value)));
        }
Пример #2
0
        public string[] Hvals(string key)
        {
            RedisNativeClient client = this.pool.GetRedisClient(key);

            return((client == null) ? null : UTF8String.ToStringArray(client.HVals(key)));
        }
Пример #3
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)));
        }
Пример #4
0
        public string[] HMGet(string key, params string[] fields)
        {
            if (!this.IsValidFields(fields))
            {
                return(null);
            }

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

            return((client == null) ? null : UTF8String.ToStringArray(client.HMGet(key, UTF8String.ToBytesArray(fields))));
        }
Пример #5
0
        public long RPushX(string key, string value)
        {
            RedisNativeClient client = this.pool.GetRedisClient(key);

            return((client == null) ? 0L : client.RPushX(key, UTF8String.ToBytes(value)));
        }
Пример #6
0
        public string[] BRPop(string key, int timeOutSecs)
        {
            RedisNativeClient client = this.pool.GetRedisClient(key);

            return((client == null) ? null : UTF8String.ToStringArray(client.BRPop(key, timeOutSecs)));
        }
Пример #7
0
        public long LRem(string key, int removeNoOfMatches, string value)
        {
            RedisNativeClient client = this.pool.GetRedisClient(key);

            return((client == null) ? 0L : client.LRem(key, removeNoOfMatches, UTF8String.ToBytes(value)));
        }
Пример #8
0
        public string RPop(string key)
        {
            RedisNativeClient client = this.pool.GetRedisClient(key);

            return((client == null) ? null : UTF8String.ToString(client.RPop(key)));
        }
Пример #9
0
        public string[] LRange(string key, int start, int end)
        {
            RedisNativeClient client = this.pool.GetRedisClient(key);

            return((client == null) ? null : UTF8String.ToStringArray(client.LRange(key, start, end)));
        }
Пример #10
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)));
        }
Пример #11
0
        public string RemoveEndFromList(string listId)
        {
            RedisNativeClient client = this.pool.GetRedisClient(listId);

            return((client == null) ? null : UTF8String.ToString(client.RPop(listId)));
        }
Пример #12
0
        public List <string> GetRangeFromList(string key, int start, int end)
        {
            RedisNativeClient client = this.pool.GetRedisClient(key);

            return((client == null) ? null : UTF8String.ToStringList(client.LRange(key, start, end)));
        }
Пример #13
0
        public long PrependItemToList(string listId, string value)
        {
            RedisNativeClient client = this.pool.GetRedisClient(listId);

            return((client == null) ? 0L : client.LPush(listId, UTF8String.ToBytes(value)));
        }