AsyncPHP\Doorman\Manager\ProcessManager::canRunTask PHP Method

canRunTask() private method

Checks whether a new task can be run.
private canRunTask ( AsyncPHP\Doorman\Task $task ) : boolean
$task AsyncPHP\Doorman\Task
return boolean
    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);
    }