You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As the title says, When using Process::getIterator execution hangs regardless of the timeout value. This doesn't happen when using a callback supplied to Process::wait.
Shouldn't the getIterator method internally call checkTimeout?
A workaround is to call getIterator with the ITER_NON_BLOCKING flag, and manually call checkTimeout.
foreach ($process->getIterator(Process::ITER_NON_BLOCKING) as$type => $data) {
try {
$process->checkTimeout();
} catch (\Exception$err) {
break;
}
if (empty($data)) {
usleep(100);
continue;
}
// Handle data as usual
}