modify plugin name
This commit is contained in:
@@ -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]);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user