What I want to do is to run a Symfony command separately from current request.
Goal: Generate a thumbnail from a PDF
Issue: I don't want to wait for the generation to be finished before sending response to the user.
public function __invoke($myparam)
{
$command = sprintf(
'php %s/bin/console ps:media:generate-thumbnail %s %s &',
$this->kernel->getProjectDir(),
'destinationPath',
'sourcePath'
);
exec($command);
}
Issue is, server still wait for the command to be done before sending response