Ejemplo n.º 1
0
        /// <summary>
        /// Execute all jobs in the scheduler.
        /// </summary>
        public void ExecuteAll()
        {
            while (scheduler.HasJobs())
            {
                Job job = scheduler.PopJob();
                running.Add(job);
                job.State = State.Running;
                DatabaseModule.LogAction(job, "running");

                job.Process(new[] { "Lars" });
                running.Remove(job);
                job.State = State.Terminated;
                DatabaseModule.LogAction(job, "terminated");
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Remove a job from scheduler, change state of job and trigger event.
 /// </summary>
 /// <param name="job">Job object</param>
 public void Cancel(Job job)
 {
     scheduler.RemoveJob(job);
     job.State = State.Cancelled;
     DatabaseModule.LogAction(job, "cancelled");
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Add a job to scheduler, change state of job and trigger event.
 /// </summary>
 /// <param name="job"></param>
 public void Submit(Job job)
 {
     scheduler.AddJob(job);
     job.State = State.Submitted;
     DatabaseModule.LogAction(job, "submitted");
 }