Ejemplo n.º 1
0
        public IVolatileToken When(string key, TimeSpan duration)
        {
            var token = new AbsoluteExpirationToken(this, duration);

            timeCache[key] = token;
            return(token);
        }
Ejemplo n.º 2
0
        public IVolatileToken WhenUtc(string key, DateTime absoluteUtc)
        {
            var token = new AbsoluteExpirationToken(this, absoluteUtc);

            timeCache[key] = token;
            return(token);
        }
Ejemplo n.º 3
0
 private void _timer_Elapsed(object sender, ElapsedEventArgs e)
 {
     foreach (KeyValuePair <string, IVolatileToken> token in timeCache)
     {
         if (!token.Value.IsCurrent)
         {
             IVolatileToken _token = new AbsoluteExpirationToken(this, TimeSpan.Zero);
             EngineContext.Current.Resolve <ICacheClient>().Remove(token.Key);
             timeCache.TryRemove(token.Key, out _token);
         }
     }
 }
Ejemplo n.º 4
0
 private void _timer_Elapsed(object sender, ElapsedEventArgs e)
 {
     foreach (KeyValuePair <string, IVolatileToken> token in timeCache)
     {
         if (!token.Value.IsCurrent)
         {
             IVolatileToken _token = new AbsoluteExpirationToken(this, TimeSpan.Zero);
             MemcachedHelper.GetInstance().Remove(token.Key);
             timeCache.TryRemove(token.Key, out _token);
         }
     }
 }