This commit is contained in:
2023-11-30 11:40:04 +08:00
parent 8781b4dc45
commit 04b1aab406
+5 -5
View File
@@ -17,7 +17,7 @@ use Swoole\Coroutine;
abstract class BaseProcess implements OnProcessInterface abstract class BaseProcess implements OnProcessInterface
{ {
protected bool $isStop = false; private bool $stop = false;
protected bool $redirect_stdin_and_stdout = FALSE; protected bool $redirect_stdin_and_stdout = FALSE;
@@ -63,7 +63,7 @@ abstract class BaseProcess implements OnProcessInterface
*/ */
public function isStop(): bool public function isStop(): bool
{ {
return $this->isStop; return $this->stop;
} }
/** /**
@@ -94,9 +94,9 @@ abstract class BaseProcess implements OnProcessInterface
/** /**
* *
*/ */
public function onProcessStop(): void public function stop(): void
{ {
$this->isStop = true; $this->stop = true;
} }
@@ -112,7 +112,7 @@ abstract class BaseProcess implements OnProcessInterface
*/ */
protected function onShutdown($data): void protected function onShutdown($data): void
{ {
$this->isStop = true; $this->stop = true;
$value = Context::get('waite:process:message'); $value = Context::get('waite:process:message');
$this->logger->alert('Process ' . $this->getName() . ' stop'); $this->logger->alert('Process ' . $this->getName() . ' stop');
if (!is_null($value) && Coroutine::exists((int)$value)) { if (!is_null($value) && Coroutine::exists((int)$value)) {