setName('xqueue:stop')->setDescription('平滑停止异步任务守护的主进程'); } /** * 停止所有任务执行 * @param Input $input * @param Output $output */ protected function execute(Input $input, Output $output) { $this->cmd = "{$this->bin} xqueue:"; foreach ($this->queryProcess() as $item) { $this->closeProcess($item['pid']); $output->writeln(">>> 发送结束进程{$item['pid']}指令成功"); } $output->info(">>> 所有异步任务进程的结束指令发送成功"); } }