Пример #1
0
 internal static RedisConnectionMultiplexer GetMultiplexer()
 {
     lock (Locker)
     {
         return(_multiplexer ?? (_multiplexer = new RedisConnectionMultiplexer()));
     }
 }
Пример #2
0
        internal RedisStringStorageClient()
        {
            var configurationManager = new ConfigurationManager();

            var indexConfiguration = configurationManager.GetConfigKey(Constants.RedisDatabaseIndex);

            var databaseIndex = string.IsNullOrEmpty(indexConfiguration) ? Constants.DefaultDatabaseIndex : int.Parse(indexConfiguration);

            _redisDatabase = RedisConnectionMultiplexer.GetMultiplexer().Connection.GetDatabase(databaseIndex);
        }