public T ListDequeue <T>(string key) where T : class { RedisValue redisValue = _cache.ListRightPop(key); if (!redisValue.HasValue) { return(null); } return(JsonConvert.DeserializeObject <T>(redisValue)); }
/// <summary> /// 移除并返回存储在该键列表的最后一个元素 /// </summary> /// <param name="redisKey"></param> /// <returns></returns> public string ListRightPop(string redisKey) { redisKey = GetKeyForRedis(redisKey); return(_database.ListRightPop(redisKey)); }