public void GetPendingTasks() { var repository = new TaskRepository(); var tasks = repository.GetPendingTasks().ToList(); foreach(var task in tasks) { Console.WriteLine(task.Name); } }
public void GetPendingTasks() { var repository = new TaskRepository(); var tasks = repository.GetPendingTasks().ToList(); foreach (var task in tasks) { Console.WriteLine(task.Name); } }
public void Poll(ThreadController controller) { controller.Wait(); // check for pause/abort while (true) { try { var tasks = _repository.GetPendingTasks(); foreach (var task in tasks) { var taskToRun = task; controller.Start(c => _executor.Execute(taskToRun, controller)); } } finally { // TODO: configurable polling interval controller.Wait(TimeSpan.FromMinutes(1)); } } }