Esempio n. 1
0
        /// <summary>
        /// 创建链接池管理对象
        /// </summary>
        private static void CreateManager()
        {
            redisConfigInfo = RedisConfigs.GetConfigInfo();
            string[] writeServerList = redisConfigInfo.WriteServerList.Split(',');
            string[] readServerList  = redisConfigInfo.ReadServerList.Split(',');

            prcm = new PooledRedisClientManager(readServerList, writeServerList,
                                                new RedisClientManagerConfig
            {
                MaxWritePoolSize = redisConfigInfo.MaxWritePoolSize,
                MaxReadPoolSize  = redisConfigInfo.MaxReadPoolSize,
                AutoStart        = redisConfigInfo.AutoStart
            });
        }
Esempio n. 2
0
 public static RedisConfigInfoSection GetConfigInfo()
 {
     try
     {
         if (_config == null)
         {
             _config = ConfigurationManager.GetSection("redis") as RedisConfigInfoSection;
         }
     }
     catch
     {
         throw new NoNullAllowedException("redis配置不可为空");
     }
     return(_config);
 }