public void AddJob(Job job) { job.JobManager = this; lock (_jobs) { _jobs.Add(job); } }
protected internal virtual void StartJob(Job job) { lock (_runningJobs) { if (!_runningJobs.Contains(job)) _runningJobs.Add(job); } job.Execute(); }
internal void JobFinished(Job job) { int count; lock (_runningJobs) { _runningJobs.Remove(job); count = _runningJobs.Count; } if (count == 0) { Running = false; OnJobManagerFinished(); } }
//we request the HostedJobHttpHandler or its Proxy via this worker and inject //the job instance into the request. HostJobHttpHandler will call private HostedJobWorkerRequest CreateWorkerRequest(Job job) { return new HostedJobWorkerRequest(JobHandlerPage, string.Empty, _output) { Job = job }; }
internal static JobExecutionContext Create(Job job) { var result = new JobExecutionContext(); result.Job = job; return result; }