Skip to content

Commit

Permalink
fix!
Browse files Browse the repository at this point in the history
  • Loading branch information
VennDev authored Aug 29, 2024
1 parent dea2f1d commit ae30ce2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/vennv/vapm/CoroutineGen.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ private static function schedule(ChildCoroutine $childCoroutine): void
public static function run(): void
{
if (!self::$taskQueue?->isEmpty()) {
/** @phpstan-ignore-next-line */
$coroutine = self::$taskQueue->dequeue();
if ($coroutine instanceof ChildCoroutine && !$coroutine->isFinished()) {
self::schedule($coroutine->run());
Expand Down
3 changes: 2 additions & 1 deletion src/vennv/vapm/EventLoop.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class EventLoop implements EventLoopInterface
protected static int $nextId = 0;

/**
* @var SplQueue
* @var SplQueue<Promise>
*/
protected static SplQueue $queues;

Expand Down Expand Up @@ -145,6 +145,7 @@ protected static function run(): void

$i = 0;
while (!self::$queues->isEmpty() && $i++ < self::LIMIT) {
/** @var Promise $promise */
$promise = self::$queues->dequeue();
$fiber = $promise->getFiber();
if ($fiber->isSuspended()) $fiber->resume();
Expand Down

0 comments on commit ae30ce2

Please sign in to comment.