public RedisClient(RedisConfiguration configuration)
        {
            if (!Databases.ContainsKey(configuration.Host))
            {
                lock (RedisLock)
                {
                    if (!Databases.ContainsKey(configuration.Host))
                    {
                        Databases[configuration.Host] = ConnectionMultiplexer.Connect(configuration.Host).GetDatabase();
                    }
                }
            }

            _database = Databases[configuration.Host];
            _key      = configuration.Key;
        }
Beispiel #2
0
 public RedisSink(RedisConfiguration configuration, ITextFormatter formatter)
 {
     _formatter = formatter;
     _client    = new RedisClient(configuration);
 }