public Status SendStatusUpdate(TaskStatus status)
 {
     return _bridge.SendStatusUpdate(status);
 }
 public Status AcknowledgeStatusUpdate(TaskStatus status)
 {
     return _bridge.AcknowledgeStatusUpdate(status);
 }
Beispiel #3
0
        public void StatusUpdate(ISchedulerDriver driver, TaskStatus status)
        {
            if (status.state.IsTerminal())
            {
                Console.WriteLine($"Status update: task '{status.task_id.value}' has terminated with state '{status.state}'.");
                var finishedTasksCount = Interlocked.Increment(ref _finishedTasksCount);

                if (finishedTasksCount == MaxTasksToRun)
                {
                    Console.WriteLine("Reached the max number of tasks to run. Stopping...");

                    var dotWritePath = Path.Combine(_outputDir, "result.dot");
                    DotHelper.Write(dotWritePath, _crawlResults, _renderResults);
                    driver.Stop();
                }
            }
            else
            {
                Console.WriteLine($"Status update: task '{status.task_id.value}' is in state '{status.state}'.");
            }
        }