Beispiel #1
0
 public static RedisPool Create()
 {
     if (redisPool == null)
     {
         redisPool = new RedisPool();
     }
     return(redisPool);
 }
 /// <summary>
 /// 初始化
 /// </summary>
 /// <param name="zkhosts">ZK地址,多个以“,”分割</param>
 /// <param name="db_proxy">CodisProxy实例节点</param>
 /// <param name="defaultdb">默认redis连接DB</param>
 public static void Init(string zkhosts, string db_proxy, int defaultdb = 0)
 {
     instance = SERedisClient.Create().CuratorClient(zkhosts, 60).ZkProxyDir(db_proxy).DefaultDB(defaultdb).Build();
 }
 /// <summary>
 /// 初始化
 /// </summary>
 /// <param name="zkhosts">ZK地址,多个以“,”分割</param>
 /// <param name="db_proxy">CodisProxy实例节点</param>
 /// <param name="poolSize">连接池大小,默认1个</param>
 /// <param name="defaultdb">默认redis连接DB</param>
 public static void Init(string zkhosts, string db_proxy, int poolSize = 1, int defaultdb = 0)
 {
     redisPool = RoundRobinSSRedisPool.Create().CuratorClient(zkhosts, 60).ZkProxyDir(db_proxy).PoolConfig(poolSize, defaultdb).Build();
 }