Esempio n. 1
0
        public TimedDictionary()
        {
            _dict = new ConcurrentDictionary <TKey, TimedValue <TValue> >();

            CleanUpPeriod = TimeSpan.FromSeconds(1);
            TimedDictionaryWorker.Register(this);
        }
Esempio n. 2
0
        protected virtual void Dispose(bool disposing)
        {
            lock (_disposeLock)
            {
                if (!_disposed)
                {
                    TimedDictionaryWorker.Unregister(this);

                    _disposed = true;
                    if (disposing)
                    {
                        GC.SuppressFinalize(this);
                    }
                }
            }
        }
Esempio n. 3
0
 private void Initialize(TimeSpan defaultExpiry, TimeSpan cleanUpPeriod)
 {
     CleanUpPeriod = cleanUpPeriod;
     DefaultExpiry = defaultExpiry;
     TimedDictionaryWorker.Register(this);
 }