private void _events_RemoveFromHeuristics(object sender, RemoveHeuristicsEventArgs e)
 {
     if (e.SingleForRemoval != null)
     {
         _cachedInfos.Remove(e.SingleForRemoval);
     }
     else
     {
         foreach (HeuristicsInfo expired in e.CollectionForRemoval)
         {
             _cachedInfos.Remove(expired);
         }
     }
 }
        public void Collect(object?state)
        {
            HeuristicsInfo[] expired = _heuristics.GetExpiredCache();
            if (expired.Length == 0)
            {
                return;
            }

            RemoveHeuristicsEventArgs removeArgs = new RemoveHeuristicsEventArgs
            {
                CollectionForRemoval = expired
            };

            _events.OnRemoveFromHeuristics(removeArgs);
        }
Пример #3
0
 public void OnRemoveFromHeuristics(RemoveHeuristicsEventArgs args)
 {
     RemoveFromHeuristics?.Invoke(this, args);
 }
Пример #4
0
        private void _events_RemoveFromHeuristics(object sender, RemoveHeuristicsEventArgs e)
        {
            HeuristicsInfo expired = _cachedInfos.FirstOrDefault(x => x.Channel == e.Channel && x.ChannelMethod == e.ChannelMethod);

            _cachedInfos.Remove(expired);
        }