Manage background tasks with PHP-Resque and Supervisor
PHP-Resque, the PHP equivalent to Ruby’s really nice background process runner is a great way to execute long running PHP processes. Supervisor is a python-based process control system, essentially it’s a convenient way to manage custom system processes you need to handle. Combining the two to manage long running PHP jobs makes a lot of sense but it takes a little bit of work to get them talking. Once you’ve gotten PHP-Resque installed on your project, you’ve added items to your queue and written the workers to handle the background tasks. You’ll need to plug PHP-Resque into supervisor. Here’s a sample config file I used to manage php resque queues within Yii projects but it should work with anything that’s using php-resque. ...