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

stopSiblingTasks() private method

Stops sibling processes of a task.
private stopSiblingTasks ( AsyncPHP\Doorman\Task $task )
$task AsyncPHP\Doorman\Task
    private function stopSiblingTasks(Task $task)
    {
        $handler = $task->getHandler();
        $stdout = $this->getStdOut();
        $stderr = $this->getStdErr();
        foreach ($this->running as $task) {
            if ($task->getHandler() === $handler && $task instanceof Process) {
                $this->getShell()->exec("kill -9 %s {$stdout} {$stderr} &", [$task->getId()]);
            }
        }
        return $this;
    }