Exemplo n.º 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.");
            }
        }
Exemplo n.º 2
0
 public MemoryCacheDriver(IConfiguration config, IPenguinPersistenceDriver driver, GlobalCache globalCache)
 {
     this.config      = config;
     this.driver      = driver;
     this.globalCache = globalCache;
 }
Exemplo n.º 3
0
 public MemoryCacheManager(IPenguinPersistenceDriver driver)
 {
     this.driver = driver;
     this.cache  = new GlobalCache(defaultCacheCount);
 }