From b7f14c546632c525496785306b3d5c2568fe429b Mon Sep 17 00:00:00 2001 From: VennV <111500380+VennDev@users.noreply.github.com> Date: Thu, 11 Jul 2024 07:56:51 +0700 Subject: [PATCH] Fix some wrongs in EventLoop.php --- src/vennv/vapm/EventLoop.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/vennv/vapm/EventLoop.php b/src/vennv/vapm/EventLoop.php index b44de440..a48fdc42 100644 --- a/src/vennv/vapm/EventLoop.php +++ b/src/vennv/vapm/EventLoop.php @@ -197,6 +197,7 @@ protected static function run(): void } if ($fiber->isTerminated() && ($promise->getStatus() !== StatusPromise::PENDING || $promise->isJustGetResult())) { + if ($promise->isJustGetResult()) $promise->setResult($fiber->getReturn()); MicroTask::addTask($id, $promise); self::removeQueue($id); } @@ -216,4 +217,4 @@ protected static function runSingle(): void while (count(self::$queues) > 0 || count(MicroTask::getTasks()) > 0 || count(MacroTask::getTasks()) > 0 || count(GreenThread::getFibers()) > 0) self::run(); } -} \ No newline at end of file +}