/// <summary>
 /// Process a session for new XEvents if it meets the polling criteria
 /// </summary>
 private void ProcessSession(ProfilerSession session)
 {
     if (session.TryEnterPolling())
     {
         Task.Factory.StartNew(() =>
         {
             var events = PollSession(session);
             if (events.Count > 0)
             {
                 SendEventsToListeners(session.SessionId, events);
             }
         });
     }
 }
Exemple #2
0
 /// <summary>
 /// Process a session for new XEvents if it meets the polling criteria
 /// </summary>
 private void ProcessSession(ProfilerSession session)
 {
     if (session.TryEnterPolling())
     {
         Task.Factory.StartNew(() =>
         {
             var events      = PollSession(session);
             bool eventsLost = session.EventsLost;
             if (events.Count > 0 || eventsLost)
             {
                 // notify all viewers for the polled session
                 List <string> viewerIds = this.sessionViewers[session.XEventSession.Id];
                 foreach (string viewerId in viewerIds)
                 {
                     if (allViewers[viewerId].active)
                     {
                         SendEventsToListeners(viewerId, events, eventsLost);
                     }
                 }
             }
         });
     }
 }