start(); $listener = new Listener($process->getStdOut()); while (yield $listener->advance()) { echo $listener->getCurrent(); } echo "Process exited with {$listener->getResult()}.\n"; }));