예제 #1
0
 /**
  * Checks whether a new task can be run.
  *
  * @param Task $task
  *
  * @return bool
  */
 private function canRunTask(Task $task)
 {
     if (!$task->canRunTask()) {
         return false;
     }
     if ($task->ignoresRules()) {
         return true;
     }
     $processes = array_filter($this->running, function (Task $task) {
         return $task instanceof Process;
     });
     if (count($processes) < 1) {
         return true;
     }
     $profile = $this->getProfileForProcesses($task, $processes);
     return $this->getRules()->canRunTask($task, $profile);
 }
예제 #2
0
 /**
  * @inheritdoc
  *
  * @return bool
  */
 public function ignoresRules()
 {
     return $this->task->ignoresRules();
 }