Exemplo n.º 1
0
 public RedisList(string key)
 {
     this.Key   = key;
     this.redis = RedisClientManager.GetClient();
 }
        /// <summary>
        /// 获取一个Redis只读客户端
        /// </summary>
        /// <returns></returns>
        public static IRedisClient GetReadOnlyClient()
        {
            var prcm = RedisClientManager.GetClientManager();

            return(prcm.GetReadOnlyClient());
        }
        /// <summary>
        /// 异步:要求Redis对缓存进行持久化
        /// </summary>
        public static void SaveAsync()
        {
            IRedisClient redis = RedisClientManager.GetClient();

            redis.SaveAsync();
        }
        /// <summary>
        /// 获取一个Redis缓存客户端
        /// </summary>
        /// <returns></returns>
        public static ICacheClient GetCacheClient()
        {
            var prcm = RedisClientManager.GetClientManager();

            return(prcm.GetCacheClient());
        }