From 4ab001b76898325f2de08fbc823c99ca557bf267 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Mon, 1 Mar 2021 17:22:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- System/Abstracts/BaseApplication.php | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/System/Abstracts/BaseApplication.php b/System/Abstracts/BaseApplication.php index 1c660d2a..daf92167 100644 --- a/System/Abstracts/BaseApplication.php +++ b/System/Abstracts/BaseApplication.php @@ -93,10 +93,10 @@ abstract class BaseApplication extends Service } - /** - * @return $this - */ - public function stateInit() + /** + * @return $this + */ + public function stateInit(): static { $this->taskNumber = 0; $this->state = 'SWOOLE_WORKER_IDLE'; @@ -105,24 +105,25 @@ abstract class BaseApplication extends Service } - /** - * @return $this - */ - public function decrement() + /** + * @return $this + */ + public function decrement(): static { $this->taskNumber -= 1; if ($this->taskNumber <= 0) { $this->taskNumber = 0; $this->state = 'SWOOLE_WORKER_IDLE'; } + var_dump($this->state); return $this; } - /** - * @return $this - */ - public function increment() + /** + * @return $this + */ + public function increment(): static { $this->taskNumber += 1; if ($this->taskNumber < 1) { @@ -131,6 +132,7 @@ abstract class BaseApplication extends Service } else { $this->state = 'SWOOLE_WORKER_BUSY'; } + var_dump($this->state); return $this; }