Example #1
0
		/// <summary>
		/// Initializes a new instance of the <see cref="T:Guanima.Redis.RedisClient"/> using the specified configuration instance.
		/// </summary>
		/// <param name="configuration">The client configuration.</param>
        public RedisClient(IRedisClientConfiguration configuration)
		{
			if (configuration == null)
				throw new ArgumentNullException("configuration");

			Initialize(configuration);
		}
Example #2
0
        private void Initialize(IRedisClientConfiguration configuration)
        {
            IServerPool pool = new DefaultServerPool(configuration);

            Initialize(pool);
            _serverPool = pool;
            _currentDb = configuration.DefaultDB; // ???
            _commandQueues = new Dictionary<IRedisNode, RedisCommandQueue>();
        }
Example #3
0
		public DefaultServerPool(IRedisClientConfiguration configuration)
		{
			if (configuration == null)
				throw new ArgumentNullException("configuration", "Invalid or missing pool configuration. Check if the Guanima/Redis section or your custom section presents in the app/web.config.");

			_configuration = configuration;
			_isAliveTimer = new Timer(callback_isAliveTimer, null, (int)_configuration.SocketPool.DeadTimeout.TotalMilliseconds, (int)this._configuration.SocketPool.DeadTimeout.TotalMilliseconds);

			// create the key transformer instance
			Type t = _configuration.KeyTransformer;
			_keyTransformer = (t == null) ? new DefaultKeyTransformer() : (IRedisKeyTransformer)FastActivator.CreateInstance(t);

			// create the item _transcoder instance
			t = _configuration.Transcoder;
			_transcoder = (t == null) ? new DefaultTranscoder() : (ITranscoder)FastActivator.CreateInstance(t);
		}
 public RedisClient(IRedisClientConfiguration configuration)
 {
     _redisConnection = ConnectionMultiplexer.Connect(configuration.RedisEndpoints);
 }