PHP Queue Manager is a PHP component for developers to optimize their site performance by moving long executing tasks to Queue.
- Multiple queues
- Unlimited messages in queue
- Queues can be executed by multiple instances simultaneously
- SQL transaction is used to ensure select only new messages for execution
- Queues and messages are saved in SQLite database
- Perfect to control mass mail sending
- Easily create custom tasks by extending one abstract class
- PHPUnit tested
- PHP 5.3 support
- Failover mechanism with timeouts
- Component includes simple console manager for viewing and executing messages in queue
- Exceptions are logged to database
Queue managers are very commonly used in enterprise applications, banking systems, financial institutions, image and video processing websites such as Vimeo or YouTube and many more.
Using this simple PHP queue manager you can also make your user happy.
If your message could not be executed (throws an exception) queue manager will try to execute it after timeout.
Where it can be used
In general this component can be useful for anyone who wants to move long running tasks to background while keeping your site visitor happy.
- Mail sending and newsletters
- Image processing
- Video processing
- Instant payment notification processing
- Logging system
- Save data to Google spreadsheet
- Web crawling
- API call requests
- A lot more ...
Requirements and installation
Queue manager can be included in any existing project simply by including class.
- PHP 5.3 (can be ported to PHP 5.2 on request)
- PDO Sqlite extension enabled (can be ported to use any database on request)
After downloading package extract it to your library directory.
Make sure you have class autoloader enabled. An example autoloader is available at [GitHub](https://gist.github.com/1135017 "Gist")
Ensure that apache have the permission to write the queue.sqlite file.
If your Apache or CLI runs with the users permissions it is enough to
chmod 755 queue.sqlite
Else you can do
chmod 777 queue.sqlite
If running from Apache then you need write and execute privileges for Apache on the directory that contains your sqlite database (not just the database file itself).