Run a Symfony Command asynchronously

  asynchronous, command, php, process, symfony

I tried to run the following :

$process = new Process(['php', 'bin/console', 'app:run-batch', $batch->getId()],

But the process doesn’t run at all. Then if I add this line to wait for the process to end :


It works, but the thing is that I specifically put my code in a command to be able to run it asynchronously. Anybody can help me on this ? Would be greatly appreciated !

Source: Symfony Questions