예제 #1
0
        public MemoryCacheManager(IConfiguration config, IPenguinPersistenceDriver driver)
        {
            this.config = config;
            this.driver = driver;

            int cacheCount;

            if (int.TryParse(config["memory_cache_count"], out cacheCount))
            {
                this.cache = new GlobalCache(cacheCount);
            }
            else
            {
                throw new PersistenceException("Invalid memory_cache_count configuration, must be a number.");
            }
        }
예제 #2
0
 public MemoryCacheDriver(IConfiguration config, IPenguinPersistenceDriver driver, GlobalCache globalCache)
 {
     this.config      = config;
     this.driver      = driver;
     this.globalCache = globalCache;
 }
예제 #3
0
 public MemoryCacheManager(IPenguinPersistenceDriver driver)
 {
     this.driver = driver;
     this.cache  = new GlobalCache(defaultCacheCount);
 }