This commit is contained in:
2026-04-17 16:30:52 +08:00
parent 16b8df159a
commit 4cfd04c988
7 changed files with 346 additions and 22 deletions
+5
View File
@@ -34,6 +34,9 @@ class OnRequest implements OnRequestInterface
public RouterCollector $router;
public DataGrip $dataGrip;
/**
* @var ExceptionHandlerInterface
*/
@@ -59,6 +62,7 @@ class OnRequest implements OnRequestInterface
*/
public function __construct(public ResponseInterface $response, DataGrip $dataGrip)
{
$this->dataGrip = $dataGrip;
$this->responseEmitter = $this->response->emmit;
$exception = \config('servers.request.exception');
if (!in_array(ExceptionHandlerInterface::class, class_implements($exception))) {
@@ -82,6 +86,7 @@ class OnRequest implements OnRequestInterface
/** @var CQ $PsrRequest */
Context::set(ResponseInterface::class, new ConstrictResponse($this->response->contentType));
$PsrRequest = Context::set(RequestInterface::class, CQ::builder($request));
$this->router = $this->dataGrip->get(ROUTER_TYPE_HTTP);
CoordinatorManager::utility(Coordinator::WORKER_START)->yield();