Пример #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;
 }
Пример #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));
            }
        }
Пример #3
0
 /// <inheritdoc />
 public RedisSentinelResolver(RedisSentinel sentinel, IEnumerable <string> masters, IEnumerable <string> slaves)
     : this(sentinel, RedisEndpoint.Create(masters), RedisEndpoint.Create(slaves))
 {
 }
Пример #4
0
 /// <inheritdoc />
 public RedisSentinelResolver(RedisSentinel sentinel)
     : this(sentinel, Array.Empty <RedisEndpoint>(), Array.Empty <RedisEndpoint>())
 {
 }