Closed alparslanahmed closed 1 year ago
Facing the same issue
Hi, I'm facing the same issue but with PHP 8.1.
php -v
PHP 8.1.22 (cli) (built: Aug 29 2023 10:30:06) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.22, Copyright (c) Zend Technologies
with Zend OPcache v8.1.22, Copyright (c), by Zend Technologies
with Xdebug v3.2.1, Copyright (c) 2002-2023, by Derick Rethans
Code
<?php
$autoloader = require __DIR__ . '/vendor/autoload.php';
use Spatie\Async\Pool;
$pool = Pool::create();
foreach (range(1, 5) as $i) {
$pool[] = async(function () use ($i) {
$output = $i * 2;
return $output;
})->then(function (int $output) {
echo $output . "\n";
});
}
await($pool);
Result
4
2
8
10
...and hanging infinitely.
One Job seems to be blocking or the results didn't find the way back... Every now and then, the code will be executed with success.
Seems to be resolved with PHP 8.1.23
PHP 8.1.23 (cli) (built: Sep 2 2023 06:59:15) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.23, Copyright (c) Zend Technologies
with Zend OPcache v8.1.23, Copyright (c), by Zend Technologies
with Xdebug v3.2.1, Copyright (c) 2002-2023, by Derick Rethans
@alparslanahmed , @jokerisgod : With 8.2, version 8.2.10 was released a few days ago. Might be resolved as well for you.
@tschlaeppi yep just upgraded to 8.2.10 and it was resolved. thanks mate!
After upgrading package to the last version issue solved!
Hello,
i updated my Ubuntu system with all packages including php. After that update issue started. I am adding tasks to the pool and tasks are being completed but waiting for pool doesnt stop. It stucks at $pool->wait();