public void Stop() { Running = false; if (this.statisticsLevel.CollectQueueStats()) { queueTracking.OnStopExecution(); } gatewayManager.Stop(); }
public void RunDown() { mainQueue.CompleteAdding(); systemQueue.CompleteAdding(); if (!StatisticsCollector.CollectShedulerQueuesStats) { return; } mainQueueTracking.OnStopExecution(); systemQueueTracking.OnStopExecution(); tasksQueueTracking.OnStopExecution(); }
public void Stop() { Running = false; Utils.SafeExecute(() => { PendingInboundMessages.Writer.TryComplete(); }); if (this.statisticsLevel.CollectQueueStats()) { queueTracking.OnStopExecution(); } gatewayManager.Stop(); }
public void Stop() { Running = false; if (StatisticsCollector.CollectQueueStats) { queueTracking.OnStopExecution(); } GatewayManager.Stop(); foreach (var gateway in gatewayConnections.Values) { gateway.Stop(); } }
/// <summary> /// Shuts down this work item group so that it will not process any additional work items, even if they /// have already been queued. /// </summary> internal void Stop() { lock (lockable) { if (IsActive) { ReportWorkGroupProblem( String.Format("WorkItemGroup is being stoped while still active. workItemCount = {0}." + "The likely reason is that the task is not being 'awaited' properly.", WorkItemCount), ErrorCode.SchedulerWorkGroupStopping); } if (state == WorkGroupStatus.Shutdown) { log.Warn(ErrorCode.SchedulerWorkGroupShuttingDown, "WorkItemGroup is already shutting down {0}", this.ToString()); return; } state = WorkGroupStatus.Shutdown; if (StatisticsCollector.CollectPerWorkItemStats) { SchedulerStatisticsGroup.UnRegisterWorkItemGroup(workItemGroupStatisticsNumber); } if (StatisticsCollector.CollectGlobalShedulerStats) { SchedulerStatisticsGroup.OnWorkItemDrop(WorkItemCount); } if (StatisticsCollector.CollectShedulerQueuesStats) { queueTracking.OnStopExecution(); } foreach (Task task in workItems) { // Ignore all queued Tasks, so in case they are faulted they will not cause UnobservedException. task.Ignore(); } workItems.Clear(); } }
public void Stop() { Running = false; Utils.SafeExecute(() => { PendingInboundMessages.CompleteAdding(); }); if (StatisticsCollector.CollectQueueStats) { queueTracking.OnStopExecution(); } GatewayManager.Stop(); foreach (var gateway in gatewayConnections.Values.ToArray()) { gateway.Stop(); } }
/// <summary> /// Shuts down this work item group so that it will not process any additional work items, even if they /// have already been queued. /// </summary> internal void Stop() { lock (lockable) { if (IsActive) { ReportWorkGroupProblem( String.Format("WorkItemGroup is being stoped while still active. workItemCount = {0}." + "The likely reason is that the task is not being 'awaited' properly.", WorkItemCount), ErrorCode.SchedulerWorkGroupStopping); // Throws InvalidOperationException } if (state == WorkGroupStatus.Shutdown) { log.Warn(ErrorCode.SchedulerWorkGroupShuttingDown, "WorkItemGroup is already shutting down {0}", this.ToString()); return; } state = WorkGroupStatus.Shutdown; if (StatisticsCollector.CollectPerWorkItemStats) { SchedulerStatisticsGroup.UnRegisterWorkItemGroup(workItemGroupStatisticsNumber); } if (StatisticsCollector.CollectGlobalShedulerStats) { SchedulerStatisticsGroup.OnWorkItemDrop(WorkItemCount); } if (StatisticsCollector.CollectShedulerQueuesStats) { queueTracking.OnStopExecution(); } workItems.Clear(); } }