setName('xqueue:start')->setDescription('检查并创建异步任务监听主进程'); } /** * 执行启动操作 * @param Input $input * @param Output $output */ protected function execute(Input $input, Output $output) { $this->cmd = "{$this->bin} xqueue:listen"; if (($pid = $this->checkProcess()) > 0) { $output->comment("异步任务监听主进程{$pid}已经启动!"); } else { $this->createProcess(); if (($pid = $this->checkProcess()) > 0) { $output->comment("异步任务监听主进程{$pid}启动成功!"); } else { $output->comment('异步任务监听主进程创建失败!'); } } } }