Example #1
0
        public bool ShouldDiscard(TimeStampedLruItem <K, V> item)
        {
            if (DateTime.UtcNow - item.TimeStamp > this.timeToLive)
            {
                return(true);
            }

            return(false);
        }
Example #2
0
        public ItemDestination RouteCold(TimeStampedLruItem <K, V> item)
        {
            if (this.ShouldDiscard(item))
            {
                return(ItemDestination.Remove);
            }

            if (item.WasAccessed)
            {
                return(ItemDestination.Warm);
            }

            return(ItemDestination.Remove);
        }
Example #3
0
 public void Touch(TimeStampedLruItem <K, V> item)
 {
     item.WasAccessed = true;
 }