/// <summary> /// 重啟主要工作執行緒 /// </summary> public void Reboot() { if (IsIdle) { loop = Task.Run(() => { while (jobQueue.Count > 0) { var current = jobQueue[0]; current.Invoke(); try { current.Task.Wait(); } catch { } Remove(current); OnCompleteJob?.Invoke(this); } }); } }
private void Work_OnCompleteJob(IWorker worker) { AssignJobs(Workers, _jobQueue); OnCompleteJob?.Invoke(this); }