PHP Queue Manager and Task Executor

PHP Queue Manager and Task Executor

A simple, fast queue manager and tasks executor. Stack your tasks to queue and execute them later.

  • Language: PHP
  • Released: Aug 19, 2011
    Last Update: Sep 10, 2011

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]( "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).


Example Task in Queue

An example Message is dedicated to sending emails and it looks like this

    namespace Queue\Message;
    use Queue\Message;
    class SendMail extends Message
        public function execute()
            $message = wordwrap($this->message, 70);
            mail($this->to_email, $this->subject, $message);

In the middle of you application you would write:

    $data = array(
        'to_email' => '',
        'subject' => 'Regarding Queue manager component',
        'message' => 'Feedback about component',
    $m = new \Queue\Message\SendMail($data);
    $q = new \Queue\Queue('EmailsQueue');

And later on the day you would send a batch of maximum 1000 emails with the following code:

    $q = new \Queue\Queue('EmailsQueue');

Aint that awesome and super easy? Parallel process made very simple indeed.

By the way, you can also use Universal queue like:

    $data = array(
        'to_email' => '',
        'subject' => 'Regarding Queue manager component',
        'message' => 'Feedback about component',
    $m = new \Queue\Message\SendMail($data);
    $q = new \Queue\Queue();

Using Web Interface to manage queue

Queue manager comes with a simple (1 file) web interface to manage queues.

Login to web manager using basic auth. (Configure users within file.)

You can execute queue manually, review stuck messages. Restart queue.

See screenshots for more information.

You need to log-in or create an account
  • Create an account
  • Log-in
Please use your real name.
Activation link will be sent to this address.
Minimum 8 characters
Enter your password again

Clicking this button confirms you read and agreed to the terms of use and privacy policy.


Save your watchlist

Fill your details below to receive project updates from your watch list - including new versions, price changes and discounts.

I agree to the terms of use and privacy policy.

2 licenses, starting from From » $19.99 14 day money-back guarantee View Licenses
or Get a quote

for customization or integration services

Post a comment

Or enter your name and Email