public Cache(ILogger <Cache> logger, ILogger <CacheSync> syncLogger, IServiceProvider service, DistributeCacheConfig config) { this.service = service; this.config = config; this.logger = logger; this.caches = new ConcurrentDictionary <string, CacheInfo>(); redisClient = new CSRedisClient(config.RedisConnectionString); this.sync = new CacheSync(this, config); }
public CacheSync(Cache cache, DistributeCacheConfig config) { this.config = config; this.cache = cache; redisClient = new CSRedisClient(config.RedisConnectionString); if (string.IsNullOrEmpty(config.SyncChannel) == false) { redisClient.Subscribe(( config.SyncChannel, this.Sync)); } }
public CacheInfo(DistributeCacheConfig config) { this.config = config; this.ExpireTime = DateTime.Now.AddSeconds(this.config.ExpireSeconds); }