This commit is contained in:
2020-10-14 11:13:26 +08:00
parent fe0413ef68
commit dcb08c31e0
2 changed files with 16 additions and 17 deletions
+11 -11
View File
@@ -49,15 +49,15 @@ trait Server
*/ */
public function onHandlerListener() public function onHandlerListener()
{ {
$this->on('workerStop', $this->createHandler('workerStop')); $this->on('WorkerStop', $this->createHandler('workerStop'));
$this->on('workerExit', $this->createHandler('workerExit')); $this->on('WorkerExit', $this->createHandler('workerExit'));
$this->on('workerStart', $this->createHandler('workerStart')); $this->on('WorkerStart', $this->createHandler('workerStart'));
$this->on('workerError', $this->createHandler('workerError')); $this->on('WorkerError', $this->createHandler('workerError'));
$this->on('managerStart', $this->createHandler('managerStart')); $this->on('ManagerStart', $this->createHandler('managerStart'));
$this->on('managerStop', $this->createHandler('managerStop')); $this->on('ManagerStop', $this->createHandler('managerStop'));
$this->on('pipeMessage', $this->createHandler('pipeMessage')); $this->on('PipeMessage', $this->createHandler('pipeMessage'));
$this->on('shutdown', $this->createHandler('shutdown')); $this->on('Shutdown', $this->createHandler('shutdown'));
$this->on('start', $this->createHandler('start')); $this->on('Start', $this->createHandler('start'));
$this->addTask(); $this->addTask();
} }
@@ -70,8 +70,8 @@ trait Server
{ {
$settings = $this->setting; $settings = $this->setting;
if (($taskNumber = $settings['task_worker_num'] ?? 0) > 0) { if (($taskNumber = $settings['task_worker_num'] ?? 0) > 0) {
$this->on('finish', $this->createHandler('finish')); $this->on('Finish', $this->createHandler('finish'));
$this->on('task', $this->createHandler('task')); $this->on('Task', $this->createHandler('task'));
} }
} }
+5 -6
View File
@@ -103,7 +103,7 @@ class BaseObject implements Configure
/** /**
* @param string $message * @param mixed $message
* @param string $method * @param string $method
* @param string $file * @param string $file
* @throws * @throws
@@ -119,7 +119,7 @@ class BaseObject implements Configure
/** /**
* @param string $message * @param mixed $message
* @param string $method * @param string $method
* @param string $file * @param string $file
* @throws * @throws
@@ -134,7 +134,7 @@ class BaseObject implements Configure
} }
/** /**
* @param string $message * @param mixed $message
* @param string $method * @param string $method
* @param string $file * @param string $file
* @throws * @throws
@@ -150,17 +150,16 @@ class BaseObject implements Configure
/** /**
* @param string $message * @param mixed $message
* @param string $method * @param string $method
* @param string $file * @param string $file
* @throws
*/ */
public function warning($message, string $method = __METHOD__, string $file = __FILE__) public function warning($message, string $method = __METHOD__, string $file = __FILE__)
{ {
if (!is_string($message)) { if (!is_string($message)) {
$message = print_r($message, true); $message = print_r($message, true);
} }
echo "\033[33m[SUCCESS][" . date('Y-m-d H:i:s') . ']: ' . $message . "\033[0m"; echo "\033[33m[WARNING][" . date('Y-m-d H:i:s') . ']: ' . $message . "\033[0m";
echo PHP_EOL; echo PHP_EOL;
} }