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 +}