From 1ca83568cfa41e9b57e3a774f5b60f665e966ec7 Mon Sep 17 00:00:00 2001 From: amir Date: Sun, 1 Oct 2023 20:58:46 +0330 Subject: [PATCH] Add onStop method --- src/EventHandler.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/EventHandler.php b/src/EventHandler.php index 3f8fc9bdc..708de0a5c 100644 --- a/src/EventHandler.php +++ b/src/EventHandler.php @@ -149,6 +149,9 @@ abstract class EventHandler extends AbstractAPI $r = $r->await(); } } + if (\method_exists($this, 'onStop')) { + Shutdown::addCallback([$this, 'onStop']); + } if ($main) { $this->setReportPeers($this->getReportPeers()); }