I have a Symfony Console
command that iterates over a potentially big collection of items and does a task with each of them. Since the collection can be big, the co
You should take a look at RabbitMqBundle's signal handling. Its execute
method just links some callbacks via the pcntl_signal()
function call. A common case should look pretty much like this:
writeln('Stopping');
// Do what you need to stop your process
}
public function restartCommand(OutputInterface $output)
{
$output->writeln('Restarting');
// Do what you need to restart your process
}
}