modify plugin name

This commit is contained in:
2022-06-20 17:43:00 +08:00
parent df7299d588
commit 5e8d9ceae7
2 changed files with 12 additions and 8 deletions
+7 -5
View File
@@ -77,10 +77,10 @@ class CoroutineServer implements ServerInterface
public function initCoreServers(array $service, int $daemon = 0): void
{
// TODO: Implement initCoreServers() method.
$service = $this->genConfigService($service);
foreach ($service as $value) {
$this->addListener($value);
}
$this->servers = $this->genConfigService($service);
// foreach ($service as $value) {
// $this->addListener($value);
// }
}
@@ -175,7 +175,9 @@ class CoroutineServer implements ServerInterface
foreach ($this->servers as $server) {
Coroutine::create(function () use ($server) {
$this->runServer($server);
$this->addListener($server);
$this->runServer($this->servers[$server->name]);
});
}
});
+5 -3
View File
@@ -12,6 +12,7 @@ use Kiri\Server\Broadcast\Message;
use Kiri\Server\Contract\OnProcessInterface;
use Kiri\Server\Events\OnProcessStart;
use Psr\Log\LoggerInterface;
use Swoole\Coroutine;
use Swoole\Process;
use Kiri\Server\Events\OnProcessStop;
use Kiri\Di\ContainerInterface;
@@ -150,16 +151,17 @@ class ProcessManager
*/
protected function poolManager(array $processes): void
{
$manager = new Process\Manager();
foreach ($processes as $process) {
/** @var BaseProcess $customProcess */
[$customProcess, $sProcess] = $this->add($process);
$this->_process[$customProcess->getName()] = $customProcess;
$manager->add($sProcess, $customProcess->isEnableCoroutine());
Coroutine::create(function () use ($customProcess) {
$customProcess->onSigterm()->process(null);
});
}
$manager->start();
}