改名
This commit is contained in:
@@ -96,7 +96,7 @@ abstract class BaseApplication extends Service
|
|||||||
/**
|
/**
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function stateInit()
|
public function stateInit(): static
|
||||||
{
|
{
|
||||||
$this->taskNumber = 0;
|
$this->taskNumber = 0;
|
||||||
$this->state = 'SWOOLE_WORKER_IDLE';
|
$this->state = 'SWOOLE_WORKER_IDLE';
|
||||||
@@ -108,13 +108,14 @@ abstract class BaseApplication extends Service
|
|||||||
/**
|
/**
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function decrement()
|
public function decrement(): static
|
||||||
{
|
{
|
||||||
$this->taskNumber -= 1;
|
$this->taskNumber -= 1;
|
||||||
if ($this->taskNumber <= 0) {
|
if ($this->taskNumber <= 0) {
|
||||||
$this->taskNumber = 0;
|
$this->taskNumber = 0;
|
||||||
$this->state = 'SWOOLE_WORKER_IDLE';
|
$this->state = 'SWOOLE_WORKER_IDLE';
|
||||||
}
|
}
|
||||||
|
var_dump($this->state);
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -122,7 +123,7 @@ abstract class BaseApplication extends Service
|
|||||||
/**
|
/**
|
||||||
* @return $this
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function increment()
|
public function increment(): static
|
||||||
{
|
{
|
||||||
$this->taskNumber += 1;
|
$this->taskNumber += 1;
|
||||||
if ($this->taskNumber < 1) {
|
if ($this->taskNumber < 1) {
|
||||||
@@ -131,6 +132,7 @@ abstract class BaseApplication extends Service
|
|||||||
} else {
|
} else {
|
||||||
$this->state = 'SWOOLE_WORKER_BUSY';
|
$this->state = 'SWOOLE_WORKER_BUSY';
|
||||||
}
|
}
|
||||||
|
var_dump($this->state);
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user