public RedisManagerPool(IEnumerable <string> hosts, RedisPoolConfig config) { if (hosts == null) { throw new ArgumentNullException(nameof(hosts)); } RedisResolver = new RedisResolver(hosts, null); if (config == null) { config = new RedisPoolConfig(); } this.OnFailover = new List <Action <IRedisClientsManager> >(); this.MaxPoolSize = config.MaxPoolSize; clients = new RedisClient[MaxPoolSize]; poolIndex = 0; this.AssertAccessOnlyOnSameThread = RedisConfig.AssertAccessOnlyOnSameThread; JsConfig.InitStatics(); }
public RedisManagerPool(IEnumerable <string> hosts, RedisPoolConfig config) { if (hosts == null) { throw new ArgumentNullException("hosts"); } Hosts = hosts.ToRedisEndPoints(); if (Hosts.Count == 0) { throw new Exception("Must provide at least "); } this.RedisClientFactory = Redis.RedisClientFactory.Instance; if (config == null) { config = new RedisPoolConfig(); } this.OnFailover = new List <Action <IRedisClientsManager> >(); this.MaxPoolSize = config.MaxPoolSize; clients = new RedisClient[MaxPoolSize]; poolIndex = 0; }
public RedisManagerPool(IEnumerable<string> hosts, RedisPoolConfig config) { if (hosts == null) throw new ArgumentNullException("hosts"); RedisResolver = new RedisResolver(hosts, null); if (config == null) config = new RedisPoolConfig(); this.OnFailover = new List<Action<IRedisClientsManager>>(); this.MaxPoolSize = config.MaxPoolSize; clients = new RedisClient[MaxPoolSize]; poolIndex = 0; }
public RedisManagerPool(IEnumerable <string> hosts, RedisPoolConfig config) { if (hosts == null) { throw new ArgumentNullException("hosts"); } RedisResolver = new RedisResolver(hosts, null); if (config == null) { config = new RedisPoolConfig(); } this.OnFailover = new List <Action <IRedisClientsManager> >(); this.MaxPoolSize = config.MaxPoolSize; clients = new RedisClient[MaxPoolSize]; poolIndex = 0; }
public RedisManagerPool(IEnumerable<string> hosts, RedisPoolConfig config) { if (hosts == null) throw new ArgumentNullException("hosts"); Hosts = hosts.ToRedisEndPoints(); if (Hosts.Count == 0) throw new Exception("Must provide at least "); this.RedisClientFactory = Redis.RedisClientFactory.Instance; if (config == null) config = new RedisPoolConfig(); this.OnFailover = new List<Action<IRedisClientsManager>>(); this.MaxPoolSize = config.MaxPoolSize; clients = new RedisClient[MaxPoolSize]; poolIndex = 0; }
public RedisManagerPool(string host, RedisPoolConfig config) : this(new[] { host }, config) { }