symfony/symfony — pull request #8741 by romainneutron (2013-08-13 16:29:59+00:00)
Title: [Process][2.2] Fix #8739

| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #8739
| License | MIT

This adds a fix to #8739. Whenever a call is done to to any non-blocking methods (`Process::isRunning`, `Process::isStopped`, `Process::isTerminated`, `Process::getStatus`, `Process::getPid`...), buffers are read, and callback executed.

Such code will now work :

```
$process->start(function ($type, $data) {
echo $data;
});

while ($process->isRunning()) {
// some stuff
// callback is executed
}
```