Example #1
0
        public void DoExpirations()
        {
            Hashtable liveCacheRepresentation = cacheOperations.GetCurrentCacheState();

            MarkAsExpired(liveCacheRepresentation);
            PrepareForSweep();
            SweepExpiredItemsFromCache(liveCacheRepresentation);
        }
Example #2
0
        public void DoScavenging()
        {
            Hashtable liveCacheRepresentation = cacheOperations.GetCurrentCacheState();

            int currentNumberItemsInCache = liveCacheRepresentation.Count;

            if (scavengingPolicy.IsScavengingNeeded(currentNumberItemsInCache))
            {
                ResetScavengingFlagInCacheItems(liveCacheRepresentation);
                SortedList scavengableItems = SortItemsForScavenging(liveCacheRepresentation);
                RemoveScavengableItems(scavengableItems);
            }
        }