Exemplo n.º 1
0
 /// <inheritdoc />
 public RedisSentinelResolver(RedisSentinel sentinel, IEnumerable <RedisEndpoint> masters, IEnumerable <RedisEndpoint> slaves)
 {
     this._sentinel = sentinel;
     this.ResetMasters(masters.ToList());
     this.ResetSlaves(slaves.ToList());
     this.ClientFactory = RedisConfig.ClientFactory;
 }
Exemplo n.º 2
0
        public RedisSentinelWorker(RedisSentinel sentinel, RedisEndpoint sentinelEndpoint)
        {
            this.Id              = Interlocked.Increment(ref _idCounter);
            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 (_logger.IsDebugEnabled())
            {
                _logger.Debug(string.Format("Set up Redis Sentinel on {0}", sentinelEndpoint));
            }
        }
Exemplo n.º 3
0
 /// <inheritdoc />
 public RedisSentinelResolver(RedisSentinel sentinel, IEnumerable <string> masters, IEnumerable <string> slaves)
     : this(sentinel, RedisEndpoint.Create(masters), RedisEndpoint.Create(slaves))
 {
 }
Exemplo n.º 4
0
 /// <inheritdoc />
 public RedisSentinelResolver(RedisSentinel sentinel)
     : this(sentinel, Array.Empty <RedisEndpoint>(), Array.Empty <RedisEndpoint>())
 {
 }