Skip to content

Commit

Permalink
Fix some wrongs in EventLoop.php
Browse files Browse the repository at this point in the history
  • Loading branch information
VennDev authored Jul 11, 2024
1 parent 3ef4580 commit b7f14c5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/vennv/vapm/EventLoop.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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();
}

}
}

0 comments on commit b7f14c5

Please sign in to comment.