protected override void Run() { CancellationToken ct = Cts.Token; while (true) { // Get an application message var msg = messageCenter.WaitMessage(category, ct); if (msg == null) { if (Log.IsVerbose) { Log.Verbose("Dequeued a null message, exiting"); } // Null return means cancelled break; } #if TRACK_DETAILED_STATS if (StatisticsCollector.CollectThreadTimeTrackingStats) { threadTracking.OnStartProcessing(); } #endif ReceiveMessage(msg); #if TRACK_DETAILED_STATS if (StatisticsCollector.CollectThreadTimeTrackingStats) { threadTracking.OnStopProcessing(); threadTracking.IncrementNumberOfProcessed(); } #endif } }
protected override void Run() { CancellationToken ct = Cts.Token; while (true) { // Get an application message var msg = messageCenter.WaitMessage(category, ct); if (msg == null) { if (Log.IsEnabled(LogLevel.Debug)) { Log.Debug("Dequeued a null message, exiting"); } // Null return means cancelled break; } ReceiveMessage(msg); } }