Esempio n. 1
0
        public RedisLockManager(IOptionsMonitor <RedLockOptions> options)
        {
            this.options = options.CurrentValue;

            var configurationOptions = ConfigurationOptions.Parse(options.CurrentValue.ConnectionString);

            connection = ConnectionMultiplexer.Connect(configurationOptions);
        }
Esempio n. 2
0
        public RedisLockManager(RedLockOptions options, string connectionString)
        {
            if (ReferenceEquals(null, options))
            {
                throw new ArgumentNullException(nameof(options));
            }
            if (string.IsNullOrEmpty(connectionString))
            {
                throw new ArgumentNullException(nameof(connectionString));
            }

            this.options = options;

            var configurationOptions = ConfigurationOptions.Parse(connectionString);

            connection = ConnectionMultiplexer.Connect(configurationOptions);
        }