111
This commit is contained in:
@@ -55,12 +55,14 @@ class OnWorkerStart implements EventDispatcherInterface
|
||||
/**
|
||||
* @param $event
|
||||
* @throws \Kiri\Exception\ConfigException
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function onTaskInit($event)
|
||||
{
|
||||
$this->annotation->read(APP_PATH . 'app', 'App', [CONTROLLER_PATH]);
|
||||
|
||||
putenv('environmental=' . Kiri::TASK);
|
||||
if (is_enable_file_modification_listening()) {
|
||||
$this->annotation->read(APP_PATH . 'app', 'App', [CONTROLLER_PATH]);
|
||||
}
|
||||
|
||||
echo sprintf("\033[36m[" . date('Y-m-d H:i:s') . "]\033[0m Tasker[%d].%d start.", $event->server->worker_pid, $event->workerId) . PHP_EOL;
|
||||
|
||||
@@ -75,14 +77,17 @@ class OnWorkerStart implements EventDispatcherInterface
|
||||
*/
|
||||
public function onWorkerInit($event)
|
||||
{
|
||||
$this->annotation->read(APP_PATH . 'app');
|
||||
putenv('environmental=' . Kiri::WORKER);
|
||||
echo sprintf("\033[36m[" . date('Y-m-d H:i:s') . "]\033[0m Worker[%d].%d start.", $event->server->worker_pid, $event->workerId) . PHP_EOL;
|
||||
$this->setProcessName(sprintf('Worker[%d].%d', $event->server->worker_pid, $event->workerId));
|
||||
|
||||
if (is_enable_file_modification_listening()) {
|
||||
$this->annotation->read(APP_PATH . 'app');
|
||||
$loader = Kiri::app()->getRouter();
|
||||
$loader->_loader();
|
||||
}
|
||||
|
||||
echo sprintf("\033[36m[" . date('Y-m-d H:i:s') . "]\033[0m Worker[%d].%d start.", $event->server->worker_pid, $event->workerId) . PHP_EOL;
|
||||
|
||||
$this->setProcessName(sprintf('Worker[%d].%d', $event->server->worker_pid, $event->workerId));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -32,7 +32,8 @@ use Annotation\Attribute;
|
||||
|
||||
|
||||
/**
|
||||
* @param mixed $class
|
||||
* @param static $params
|
||||
* @param mixed $class
|
||||
* @param mixed|null $method
|
||||
* @return array
|
||||
*/
|
||||
|
||||
@@ -28,6 +28,7 @@ use Http\IInterface\MiddlewareInterface;
|
||||
|
||||
|
||||
/**
|
||||
* @param static $params
|
||||
* @param mixed $class
|
||||
* @param mixed|null $method
|
||||
* @return $this
|
||||
|
||||
@@ -24,10 +24,12 @@ use Kiri\Kiri;
|
||||
|
||||
|
||||
/**
|
||||
* @param static $params
|
||||
* @param mixed $class
|
||||
* @param mixed|null $method
|
||||
* @return Router
|
||||
* @throws Exception
|
||||
* @throws \Kiri\Exception\NotFindClassException
|
||||
* @throws \ReflectionException
|
||||
*/
|
||||
public static function execute(mixed $params, mixed $class, mixed $method = null): Router
|
||||
{
|
||||
|
||||
@@ -32,6 +32,7 @@ use Kiri\Kiri;
|
||||
|
||||
|
||||
/**
|
||||
* @param static $params
|
||||
* @param mixed $class
|
||||
* @param mixed|null $method
|
||||
* @return Router
|
||||
|
||||
Reference in New Issue
Block a user