变更
This commit is contained in:
@@ -14,6 +14,8 @@ use Kiri\Server\Abstracts\TraitServer;
|
|||||||
use Kiri\Server\Config as SConfig;
|
use Kiri\Server\Config as SConfig;
|
||||||
use Kiri\Server\Events\OnServerBeforeStart;
|
use Kiri\Server\Events\OnServerBeforeStart;
|
||||||
use Kiri\Server\Events\OnShutdown;
|
use Kiri\Server\Events\OnShutdown;
|
||||||
|
use Kiri\Server\Events\OnWorkerExit;
|
||||||
|
use Kiri\Server\Events\OnWorkerStart;
|
||||||
use Psr\Container\ContainerExceptionInterface;
|
use Psr\Container\ContainerExceptionInterface;
|
||||||
use Psr\Container\NotFoundExceptionInterface;
|
use Psr\Container\NotFoundExceptionInterface;
|
||||||
use Psr\Log\LoggerInterface;
|
use Psr\Log\LoggerInterface;
|
||||||
@@ -180,7 +182,12 @@ class CoroutineServer implements ServerInterface
|
|||||||
$this->onTasker();
|
$this->onTasker();
|
||||||
foreach ($this->servers as $server) {
|
foreach ($this->servers as $server) {
|
||||||
Coroutine::create(static function () use ($server) {
|
Coroutine::create(static function () use ($server) {
|
||||||
|
|
||||||
|
$this->dispatch->dispatch(new OnWorkerStart($server, 0));
|
||||||
|
|
||||||
$server->start();
|
$server->start();
|
||||||
|
|
||||||
|
$this->dispatch->dispatch(new OnWorkerExit($server, 0));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user