public BabbageMessageProvider(ITranslator translator) : base(translator) { var cacheConfig = new CacheConfig { Name = "appdomain.cache", Duration = 3600 }; var cache = new AppDomainCacheManager(cacheConfig); init(cache); }
public BaseTranslator() { var cacheConfig = new CacheConfig { Name = "appdomain.cache", Duration = 3600 }; var cache = new AppDomainCacheManager(cacheConfig); InitInternal(cache, new NullExceptionLogger(), new NullLogger()); }
static BaseInfo() { var ccfg = new CacheConfig { Name = "BaseInfo", Interval = 3600, Duration = 3600 }; var cache = new AppDomainCacheManager(ccfg); var provider = new SqlBaseInfoProvider(DA.DefaultDb, cache); DefaultProvider = provider; }
private void test2() { var config = new CacheConfig { Name = "Locust.Test__cache" }; var cache = new AppDomainCacheManager(config); var type = cache.Get("key1"); System.Console.WriteLine(type != null && (type as Type) == this.GetType()); }
private void test1() { var config = new CacheConfig { Name = "Locust.Test__cache" }; var cache = new AppDomainCacheManager(config); var x = cache.GetOrSet("key1", () => this.GetType()); System.Console.WriteLine(x); }
public override void Test() { var config = new CacheConfig { Name = "Locust.Test__cache" }; var cache = new AppDomainCacheManager(config); var prop = cache.Get("key1", () => myClass.GetType().GetProperty("Alpha12", BindingFlags.Public | BindingFlags.Instance)); var alpha12 = Convert.ToInt16(prop.GetValue(myClass)); alpha12++; }
public ICacheManager Get(object arg) { var cacheConfig = new CacheConfig { Name = "myCache", AutoExpire = true, AutoRemoveDeadItems = true, Duration = 5 }; var cache = new AppDomainCacheManager(cacheConfig); return(cache); }