/** * Dispatch command * * @param $command */ protected function dispatch($task) { $this->emit('execute', $task); $that = $this; $this->process->parallel(function () use($task, $that) { $status = Utils::exec($task->command, $stdout, $stderr); $that->emit('executed', $task, array($status, $stdout, $stderr)); }); }