public void CounterDelete(CounterEntry entry) { _counters.Remove(entry.Key); if (entry.ExpireAt.HasValue) { _counterIndex.Remove(entry); } }
public CounterEntry CounterGetOrAdd(string key) { if (!_counters.TryGetValue(key, out var counter)) { _counters.Add(key, counter = new CounterEntry(key)); } return(counter); }
public void CounterExpire(CounterEntry counter, TimeSpan?expireIn) { EntryExpire(counter, _counterIndex, expireIn); }