eee
This commit is contained in:
@@ -63,16 +63,15 @@ class OnRequest implements OnRequestInterface
|
||||
* @param DataGrip $dataGrip
|
||||
* @throws
|
||||
*/
|
||||
public function __construct(public ResponseInterface $response, public ContainerInterface $container,
|
||||
public DataGrip $dataGrip)
|
||||
public function __construct(public ResponseInterface $response, DataGrip $dataGrip)
|
||||
{
|
||||
$this->responseEmitter = $this->response->emmit;
|
||||
$exception = \config('exception.http');
|
||||
if (!in_array(ExceptionHandlerInterface::class, class_implements($exception))) {
|
||||
$exception = ExceptionHandlerDispatcher::class;
|
||||
}
|
||||
$this->exception = $this->container->get($exception);
|
||||
$this->router = $this->dataGrip->get(ROUTER_TYPE_HTTP);
|
||||
$this->exception = \Kiri::getDi()->get($exception);
|
||||
$this->router = $dataGrip->get(ROUTER_TYPE_HTTP);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -26,14 +26,6 @@ use function config;
|
||||
class OnServerWorker extends Kiri\Server\Abstracts\Server
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @var EventDispatch
|
||||
*/
|
||||
#[Container(EventDispatch::class)]
|
||||
public EventDispatch $dispatch;
|
||||
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
@@ -68,13 +60,14 @@ class OnServerWorker extends Kiri\Server\Abstracts\Server
|
||||
*/
|
||||
public function onWorkerStart(Server $server, int $workerId): void
|
||||
{
|
||||
$this->dispatch->dispatch(new OnBeforeWorkerStart($server, $workerId));
|
||||
$dispatch = Kiri::getDi()->get(EventDispatch::class);
|
||||
$dispatch->dispatch(new OnBeforeWorkerStart($server, $workerId));
|
||||
if ($workerId < $server->setting['worker_num']) {
|
||||
$this->dispatch->dispatch(new OnWorkerStart($server, $workerId));
|
||||
$dispatch->dispatch(new OnWorkerStart($server, $workerId));
|
||||
} else {
|
||||
$this->dispatch->dispatch(new OnTaskerStart($server, $workerId));
|
||||
$dispatch->dispatch(new OnTaskerStart($server, $workerId));
|
||||
}
|
||||
$this->dispatch->dispatch(new OnAfterWorkerStart($server, $workerId));
|
||||
$dispatch->dispatch(new OnAfterWorkerStart($server, $workerId));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user