Exemple #1
0
 public RedisSentinelResolver(RedisSentinel sentinel, IEnumerable <RedisEndpoint> masters, IEnumerable <RedisEndpoint> slaves)
 {
     this.sentinel = sentinel;
     ResetMasters(masters.ToList());
     ResetSlaves(slaves.ToList());
     ClientFactory = RedisConfig.ClientFactory;
 }
        public RedisSentinelWorker(RedisSentinel sentinel, RedisEndpoint sentinelEndpoint)
        {
            this.sentinel       = sentinel;
            this.sentinelClient = new RedisClient(sentinelEndpoint)
            {
                Db             = 0, //Sentinel Servers doesn't support DB, reset to 0
                ConnectTimeout = sentinel.SentinelWorkerConnectTimeoutMs,
                ReceiveTimeout = sentinel.SentinelWorkerReceiveTimeoutMs,
                SendTimeout    = sentinel.SentinelWorkerSendTimeoutMs,
            };

            if (Log.IsDebugEnabled)
            {
                Log.Debug("Set up Redis Sentinel on {0}".Fmt(sentinelEndpoint));
            }
        }
Exemple #3
0
 public RedisSentinelResolver(RedisSentinel sentinel, IEnumerable <string> masters, IEnumerable <string> slaves)
     : this(sentinel, masters.ToRedisEndPoints(), slaves.ToRedisEndPoints())
 {
 }
Exemple #4
0
 public RedisSentinelResolver(RedisSentinel sentinel)
     : this(sentinel, new RedisEndpoint[0], new RedisEndpoint[0])
 {
 }