add windows exit code support

This commit is contained in:
crazywhalecc
2022-08-22 21:32:00 +08:00
parent 6f30c04899
commit 05ac2feebd
2 changed files with 3 additions and 6 deletions

View File

@@ -109,7 +109,7 @@ class Framework
* 未测试
* @throws ZMKnownException
*/
public function stop()
public function stop(int $retcode = 0)
{
switch ($this->driver->getName()) {
case 'swoole':
@@ -120,7 +120,7 @@ class Framework
if (extension_loaded('posix')) {
posix_kill(ProcessStateManager::getProcessState(ZM_PROCESS_MASTER)['pid'], SIGTERM);
} else {
Worker::stopAll();
Worker::stopAll($retcode);
}
break;
}