Exemplo n.º 1
0
 /// <summary>
 /// 异常收集器
 /// </summary>
 static ExceptionCollector()
 {
     ThreadHelper.Run(() =>
     {
         while (!_isClose)
         {
             foreach (var item in _eDic)
             {
                 if (item.Value.TryDequeue(out Exception ex))
                 {
                     OnErr?.BeginInvoke(item.Key, ex, null, null);
                 }
             }
             ThreadHelper.Sleep(50);
         }
     }, true, System.Threading.ThreadPriority.Highest);
 }