This commit is contained in:
xl
2024-11-15 14:16:37 +08:00
parent 8440104053
commit edc7371d9b
2 changed files with 14 additions and 4 deletions
+5 -2
View File
@@ -4,6 +4,8 @@ declare(strict_types=1);
namespace Kiri\Router;
use Kiri\Abstracts\CoordinatorManager;
use Kiri\Coordinator;
use Kiri\Di\Inject\Container;
use Kiri\Di\Context;
use Kiri\Di\Interface\ResponseEmitterInterface;
@@ -77,8 +79,9 @@ class OnRequest implements OnRequestInterface
try {
$PsrRequest = $this->initRequestAndResponse($request);
$PsrResponse = $this->router->query($request->server['path_info'], $request->getMethod())
->run($PsrRequest);
CoordinatorManager::utility(Coordinator::WORKER_START)->yield();
$PsrResponse = $this->router->query($request->server['path_info'], $request->getMethod())->run($PsrRequest);
} catch (Throwable $throwable) {
$PsrResponse = $this->exception->emit($throwable, $this->constrictResponse);
} finally {