コード例 #1
0
 public RedisCacheManager(IRedisConnectionWrapper redisConnectionWrapper,
                          IMemoryCacheManager memoryCacheManager)
 {
     _redisConnectionWrapper = redisConnectionWrapper;
     _memoryCacheManager     = memoryCacheManager;
     this._db = _redisConnectionWrapper.Database();
 }
コード例 #2
0
        public RedisCacheManager(IRedisConnectionWrapper connectionWrapper)
        {
            //    if (String.IsNullOrEmpty(redisConnString))
            //        throw new Exception("Redis connection string is empty");

            // ConnectionMultiplexer.Connect should only be called once and shared between callers
            this._connectionWrapper = connectionWrapper;

            this._db = _connectionWrapper.Database();
        }
コード例 #3
0
        public RedisCacheManager(ChinaBeaconConfig config, IRedisConnectionWrapper connectionWrapper)
        {
            if (String.IsNullOrEmpty(config.RedisCachingConnectionString))
            {
                throw new Exception("Redis connection string is empty");
            }

            // ConnectionMultiplexer.Connect should only be called once and shared between callers
            this._connectionWrapper = connectionWrapper;

            this._db = _connectionWrapper.Database();
            this._perRequestCacheManager = EngineContext.Current.Resolve <ICacheManager>();
        }
コード例 #4
0
 public RedisCacheStore(IRedisConnectionWrapper connectionWrapper, IRedisServerSettings settings, ISerializer serializer)
 {
     _database   = connectionWrapper.Database(settings.DefaultDb);
     _serializer = serializer;
     _readFlag   = settings.PreferSlaveForRead ? CommandFlags.PreferSlave : CommandFlags.PreferMaster;
 }
コード例 #5
0
        public RedisCacheManager(IRedisConnectionWrapper connectionWrapper)
        {
            this._connectionWrapper = connectionWrapper;

            this._db = _connectionWrapper.Database();
        }
コード例 #6
0
 public RedisCacheStore(IRedisConnectionWrapper connectionWrapper, RedisSettings redisSettings)
 {
     this.database = connectionWrapper.Database(redisSettings.DefaultDb);
     this.server   = connectionWrapper.FirstServer();
     this.readFlag = redisSettings.PreferSlaveForRead ? CommandFlags.PreferSlave : CommandFlags.PreferMaster;
 }