This commit is contained in:
2021-03-02 18:16:34 +08:00
parent 104a0bfe73
commit 967bfa2b37
6 changed files with 28 additions and 8 deletions
+6
View File
@@ -6,6 +6,8 @@ namespace HttpServer\Events;
use Exception;
use HttpServer\Abstracts\Callback;
use Snowflake\Event;
use Snowflake\Snowflake;
/**
* Class OnWorkerStop
@@ -22,6 +24,10 @@ class OnWorkerStop extends Callback
*/
public function onHandler($server, $worker_id)
{
$event = Snowflake::app()->getEvent();
$event->trigger(Event::SERVER_WORKER_STOP);
$event->offName(Event::SERVER_WORKER_STOP);
$this->clear($server, $worker_id, self::EVENT_STOP);
}