Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
VennDev authored Aug 18, 2024
1 parent dbca0f0 commit 1104ae6
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/vennv/vapm/EventLoop.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ public static function addQueue(Promise $promise): void
public static function getQueue(int $id): ?Promise
{
while (!self::$queues->isEmpty()) {
/**
* @var Promise $promise
*/
$promise = self::$queues->dequeue();
if ($promise->getId() === $id) return $promise;
self::$queues->enqueue($promise);
Expand Down Expand Up @@ -147,12 +150,11 @@ protected static function run(): void
}

$i = 0;

/**
* @var Promise $promise
*/
while (!self::$queues->isEmpty()) {
if ($i++ >= self::$limit) break;
/**
* @var Promise $promise
*/
$promise = self::$queues->dequeue();

$id = $promise->getId();
Expand Down

0 comments on commit 1104ae6

Please sign in to comment.