改名
This commit is contained in:
@@ -54,12 +54,22 @@ abstract class CustomProcess implements \Server\SInterface\CustomProcess
|
||||
}
|
||||
});
|
||||
} else {
|
||||
go(function () use ($process) {
|
||||
Coroutine::create(function () use ($process) {
|
||||
/** @var Coroutine\Socket $message */
|
||||
$message = $process->exportSocket();
|
||||
error($message->recv());
|
||||
$process->exit(0);
|
||||
});
|
||||
Coroutine::create(function () use ($process) {
|
||||
$data = Coroutine::waitSignal(SIGTERM | SIGKILL, -1);
|
||||
if ($data) {
|
||||
$lists = Kiri::app()->getProcess();
|
||||
foreach ($lists as $process) {
|
||||
$process->exit(0);
|
||||
foreach ($lists as $name => $process) {
|
||||
foreach ($process as $item) {
|
||||
/** @var Coroutine\Socket $export */
|
||||
$export = $item->exportSocket();
|
||||
$export->send([$name => 'exit']);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -203,7 +203,6 @@ class ServerManager
|
||||
* @param array $config
|
||||
* @param int $daemon
|
||||
* @throws ConfigException
|
||||
* @throws NotFindClassException
|
||||
* @throws ReflectionException
|
||||
* @throws Exception
|
||||
*/
|
||||
|
||||
@@ -50,7 +50,7 @@ class Application extends BaseApplication
|
||||
public string $state = '';
|
||||
|
||||
|
||||
/** @var array<Process> */
|
||||
/** @var array<array<Process>> */
|
||||
private array $_process = [];
|
||||
|
||||
|
||||
@@ -88,7 +88,10 @@ class Application extends BaseApplication
|
||||
*/
|
||||
public function addProcess(string $class, Process $process)
|
||||
{
|
||||
$this->_process[$class] = $process;
|
||||
if (isset($this->_process[$class])) {
|
||||
$this->_process[$class] = [];
|
||||
}
|
||||
$this->_process[$class][] = $process;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user