Example #1
0
 private void OnTimerElapsed(object sender, ElapsedEventArgs e)
 {
     frozen = true;
     timer.Stop();
     TTLReached?.Invoke(this, new TTLReachedEventArgs(path, this, ttl));
 }
Example #2
0
 /// <summary>Changes the time to live (TTL) value for the cache. Changing the value will act as if the TTL was reached.</summary>
 /// <param name="newTTL">The new TTL</param>
 public void UpdateTTL(double newTTL)
 {
     IsFrozen();
     ttl = newTTL;
     TTLReached?.Invoke(this, new TTLReachedEventArgs(path, this, ttl, true));
 }