public HybridCacherTests() { // have to fake an http context to use http context cache HttpContext.Current = new HttpContext(new HttpRequest(null, "http://tempuri.org", null), new HttpResponse(null)); CacheManager.Init(TestSettings.RedisHost, TestSettings.RedisPort, TestSettings.RedisPassword, TestSettings.RedisDb, TestSettings.KeyPrefix); _cacheSleeve = CacheManager.Settings; var cacheSleeve = CacheManager.Settings; var configuration = ConfigurationOptions.Parse(string.Format("{0}:{1}", TestSettings.RedisHost, TestSettings.RedisPort)); configuration.AllowAdmin = true; var redisConnection = ConnectionMultiplexer.Connect(configuration); var subscriber = redisConnection.GetSubscriber(); subscriber.Subscribe("cacheSleeve.remove.*", (redisChannel, value) => OnSubscriptionHit(redisChannel, GetString(value))); subscriber.Subscribe("cacheSleeve.flush*", (redisChannel, value) => OnSubscriptionHit(redisChannel, "flush")); _hybridCacher = new HybridCacher(); _remoteCacher = cacheSleeve.RemoteCacher; _localCacher = cacheSleeve.LocalCacher; }
public void Dispose() { _hybridCacher.FlushAll(); _hybridCacher = null; _remoteCacher = null; _localCacher = null; }
public RedisCacherAsyncTests() { // have to fake an http context to use http context cache HttpContext.Current = new HttpContext(new HttpRequest(null, "http://tempuri.org", null), new HttpResponse(null)); CacheManager.Init(TestSettings.RedisHost, TestSettings.RedisPort, TestSettings.RedisPassword, TestSettings.RedisDb, TestSettings.KeyPrefix); _cacheSleeve = CacheManager.Settings; _redisCacher = CacheManager.Settings.RemoteCacher; }
/// <inheritdoc /> public InternalCacheSet([NotNull] ISetCollection context) { _context = context; _dictionary = new ConcurrentDictionary <string, T>(); _list = new HashSet <T>(); _constructor = typeof(T).GetConstructor(new Type[] { }); _mergeLock = new object(); _cacheMap = RedisCacher.GetCacheMap <T>(); _cachingService = new CachingPersistеnceService(_context); }
public CacheManagerTests() { // have to fake an http context to use http context cache HttpContext.Current = new HttpContext(new HttpRequest(null, "http://tempuri.org", null), new HttpResponse(null)); CacheManager.Init(TestSettings.RedisHost, TestSettings.RedisPort, TestSettings.RedisPassword, TestSettings.RedisDb, TestSettings.KeyPrefix); _cacheSleeve = CacheManager.Settings; var configuration = ConfigurationOptions.Parse(string.Format("{0}:{1}", TestSettings.RedisHost, TestSettings.RedisPort)); configuration.AllowAdmin = true; var redisConnection = ConnectionMultiplexer.Connect(configuration); var subscriber = redisConnection.GetSubscriber(); subscriber.Subscribe("cacheSleeve.remove.*", (redisChannel, value) => OnSubscriptionHit(redisChannel, GetString(value))); subscriber.Subscribe("cacheSleeve.flush*", (redisChannel, value) => OnSubscriptionHit(redisChannel, "flush")); _hybridCacher = new HybridCacher(); _remoteCacher = _cacheSleeve.RemoteCacher; _localCacher = _cacheSleeve.LocalCacher; }
public void Dispose() { _redisCacher.FlushAll(); _redisCacher = null; }
/// <summary> /// /// </summary> /// <param name="cacher"></param> /// <param name="serviceProvider"></param> public Donutfile(RedisCacher cacher, IServiceProvider serviceProvider) { //_integrationService = serviceProvider.GetService(typeof(IntegrationService)) as IntegrationService; }