public void Dispose() { while (_runningTaskCount > 0) { Thread.Sleep(_sleepInterval); } _setting = null; _queue = null; }
private static void Init() { HKHTaskSection Settings = ConfigurationManager.GetSection("hkh.tasks") as HKHTaskSection; if (Settings != null) { for (int i = 0; i < Settings.HKHTasks.Count; i++) { HKHTaskElement setting = Settings.HKHTasks[i]; ParallelTaskQueue taskQueue = Activator.CreateInstance(setting.TaskQueueType) as ParallelTaskQueue; ParallelTaskDispatcher dispatcher = new ParallelTaskDispatcher(setting, taskQueue); taskQueue.Dispatcher = dispatcher; _pool.TryAdd(setting.TaskType.FullName, taskQueue); } } else { throw new ConfigurationErrorsException("hkh.tasks section was not found."); } }
public ParallelTaskDispatcher(HKHTaskElement setting, ParallelTaskQueue taskQueue) { _setting = setting; _queue = taskQueue; }