示例#1
0
 public static void SendTaskRunningStatus(this IExecutorDriver driver, TaskID taskId)
 {
     driver.SendStatusUpdate(new TaskStatus
     {
         task_id = taskId,
         state = TaskState.TASK_RUNNING
     });
 }
示例#2
0
 public static void SendTaskFinishedStatus(this IExecutorDriver driver, TaskID taskId)
 {
     driver.SendStatusUpdate(new TaskStatus
     {
         task_id = taskId,
         state = TaskState.TASK_FINISHED
     });
 }
示例#3
0
 public static void SendTaskErrorStatus(this IExecutorDriver driver, TaskID taskId)
 {
     driver.SendStatusUpdate(new TaskStatus
         {
             task_id = taskId,
             state = TaskState.TASK_ERROR
         });
 }
示例#4
0
        private string RunRendering(TaskID taskId, string url)
        {
            var imagePath = Path.Combine(_outputDir, $"{taskId.value}.png");

            var startInfo = new ProcessStartInfo("phantomjs");
            startInfo.Arguments = $"render.js \"{url}\" \"{imagePath}\"";
            startInfo.CreateNoWindow = true;
            startInfo.UseShellExecute = false;

            var process = Process.Start(startInfo);
            process.WaitForExit();

            return imagePath;
        }
示例#5
0
 public Status KillTask(TaskID taskId)
 {
     return _bridge.KillTask(taskId);
 }
示例#6
0
 public virtual void KillTask(IExecutorDriver driver, TaskID taskId)
 {
 }