/**
* {@inheritdoc}
*/
public function wait(Process $process)
{
$start = microtime(true);
$end = $start + $this->timeout / 1000;
while (!$process->isTerminated() && microtime(true) < $end) {
usleep(self::TICK * 1000);
}
if ($process->isRunning()) {
$callback = $this->callback;
$callback();
}
$process->wait();
}