예제 #1
0
        public void Set(CachedItem <T> item)
        {
            var previous = Replace(item);

            if (previous != null && previous != item)
            {
                _onEvict?.Invoke(previous);
            }
        }
예제 #2
0
 public CachedItem <T> Replace(CachedItem <T> item)
 {
     return(Interlocked.Exchange(ref _current, item));
 }