コード例 #1
0
        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;
        }
コード例 #2
0
 public RedisSink(RedisConfiguration configuration, ITextFormatter formatter)
 {
     _formatter = formatter;
     _client    = new RedisClient(configuration);
 }