As you can read in this question in SO http://stackoverflow.com/questions/29772116/symfony2-background-process-running-after-script-ends I'm looking for a good way of executing background tasks in Symfony2.
A) Calling a background Process doesn't work, because when the script ends, it kills all processes, and they may not have finished. I want to be able to return a return and leave the task running, the user doesn't need feedback from it.
B) Calling the task from an event listener to " kernel.terminate " doesn't seem to be specific enough. As far as I understand it, you bind it to ALL "kernel.terminate" events, which is bonkers, I just want to run one task (or console command, or whatever) after one specific action in one specific controller ends.
C) Calling a cron job or hacky php is discarded for not being inside of a "framework" philosophy. It just breaks the flow. And it's not cross-platform. And it requires control over the host machine you may not have. And more reasons.
So... which are my options here? Because I feel there must be a way to do this. And if there isn't, I feel it should be a priority.