modify plugin name

This commit is contained in:
2022-06-20 18:00:00 +08:00
parent 5e8d9ceae7
commit b20c8fc5a3
2 changed files with 17 additions and 24 deletions
+8 -10
View File
@@ -5,6 +5,7 @@ namespace Kiri\Server\Abstracts;
use Kiri\Abstracts\Config;
use Kiri\Di\ContainerInterface;
use Kiri\Events\EventDispatch;
use Kiri\Exception\ConfigException;
use Kiri\Server\Constant;
use Kiri\Server\Events\OnWorkerStart;
use Kiri\Server\Events\OnWorkerStop;
@@ -78,9 +79,9 @@ class CoroutineServer implements ServerInterface
{
// TODO: Implement initCoreServers() method.
$this->servers = $this->genConfigService($service);
// foreach ($service as $value) {
// $this->addListener($value);
// }
foreach ($service as $value) {
$this->addListener($value);
}
}
@@ -165,19 +166,16 @@ class CoroutineServer implements ServerInterface
/**
* @return void
* @throws ConfigException
*/
public function start(): void
{
// TODO: Implement start() method.
$merge = array_merge(Config::get('processes', []), $this->getProcess());
$this->processManager->batch($merge);
run(function () {
$this->processManager->batch(Config::get('processes', []));
$this->processManager->batch($this->getProcess());
foreach ($this->servers as $server) {
Coroutine::create(function () use ($server) {
$this->addListener($server);
$this->runServer($this->servers[$server->name]);
$this->runServer($server);
});
}
});