Using the reactphp/child-process library,
$loop = React\EventLoop\Factory::create();
$process = new React\ChildProcess\Process(...some long proccess..);
$process->on('exit', function($exitCode, $termSignal) {
// ...
});
$process->start($loop);
$loop->run();
to kill the process should I use $process->close()
or $process->terminate()
?
Whats the difference?