Closed pmontoya closed 4 months ago
You could use a fiber for that, we use it to allow parallel running, something like this should work :
$fiber = new \Fiber(fn () => run(...))
$fiber->start();
while (!$fiber->isTerminated()) {
if ($fiber->isSuspended()) {
echo 'Still running'; // Here do you own progress indicator
$fiber->resume();
}
}
Thank you @joelwurtz !!
Hello,
I would like to display a progress indicator running a command. However, the
run()
function is sync and I don't how to switch it in async. I try withwait_for
but without any success asisTerminated
isser will be updating afterrun
process. Any idea ?If I create a PR, do you think it would be a better idea to add a
runningIndicatorMessage
torun()
function or to add a parameter to makerun
async ?Thank you for your help