Пример #1
0
        public void AddJob(Job job)
        {

            job.JobManager = this;
            lock (_jobs)
            {
                _jobs.Add(job);
            }
        }
Пример #2
0
 protected internal virtual void StartJob(Job job)
 {
     lock (_runningJobs)
     {
         if (!_runningJobs.Contains(job))
             _runningJobs.Add(job);
     }
     
     job.Execute();
 }
Пример #3
0
 internal void JobFinished(Job job)
 {
     int count;
     lock (_runningJobs)
     {
         _runningJobs.Remove(job);
         count = _runningJobs.Count;
     }
     if (count == 0)
     {
         Running = false;
         OnJobManagerFinished();
     }
 }
Пример #4
0
 //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 };
 }
Пример #5
0
 internal static JobExecutionContext Create(Job job)
 {
     var result = new JobExecutionContext();
     result.Job = job;
     return result;
 }