コード例 #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)));
        }