public void Add(IJob job, ITrigger trigger, int maxTaskNumber = 1) { JobProcess process = new JobProcess(job, maxTaskNumber); this.triggerAndProcessDict.TryAdd(trigger, process); this.triggerDict.TryAdd(job, trigger); this.processDict.TryAdd(job, process); }
internal JobTask(JobProcess process) { this.process = process; foreach (IJob job in this.process.Jobs) { this.succeedDict.Add(job, true); } }
public void Add(IEnumerable <IJob> jobs, ITrigger trigger, int maxTaskNumber = 1) { JobProcess process = new JobProcess(jobs, maxTaskNumber); this.triggerAndProcessDict.TryAdd(trigger, process); foreach (IJob job in jobs) { this.triggerDict.TryAdd(job, trigger); this.processDict.TryAdd(job, process); } }
private void schedule(DateTime time, ITrigger trigger, JobProcess process) { if (trigger.Trigger(time, process.SucceedCount, process.RunningCount)) { bool ret = true; foreach (IJob job in process.Jobs) { ret = ret && this.canRunning(job); } if (ret) { process.StartATask(); } } }