CakePHP Daemon Shell

A really excellent and useful CakePHP shell task is the Daemon Task. It allows you to run a pseudo daemon process. I say pseudo because the is no child process detached or anything of that sort. It would actually be more accurate to say that it allows you to run 1 instance of a specific task.

This is great to do things like an email sendout where multiple iterations of the same script could potentially cause problems (if for instance you run a cron job to start the script before the previous call to the same script exits). The Daemon Task takes care of this perfectly.