Home
1 site, 1 server No source distribution Commercial use allowed Can modify source 1 year support Read full license | More Info
Unlimited projects Source and binary distribution Commercial use allowed Can modify source 1 year support Read full license | More Info
Starting from $ 19.99
PHP Queue Manager is a PHP component for developers to optimize their site performance by moving long executing tasks to Queue.
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.
In general this component can be useful for anyone who wants to move long running tasks to background while keeping your site visitor happy.
Queue manager can be included in any existing project simply by including class.
After downloading package extract it to your library directory.
Make sure you have class autoloader enabled. An example autoloader is available at GitHub
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).
An example Message is dedicated to sending emails and it looks like this
<?php
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' => 'andrius.putna@gmail.com',
'subject' => 'Regarding Queue manager component',
'message' => 'Feedback about component',
);
$m = new \Queue\Message\SendMail($data);
$q = new \Queue\Queue('EmailsQueue');
$q->send($m);
And later on the day you would send a batch of maximum 1000 emails with the following code:
$q = new \Queue\Queue('EmailsQueue');
$q->execute(1000);
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' => 'andrius.putna@gmail.com',
'subject' => 'Regarding Queue manager component',
'message' => 'Feedback about component',
);
$m = new \Queue\Message\SendMail($data);
$q = new \Queue\Queue();
$q->send($m);
$q->execute(1000);
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.
Starting from $ 19.99
Questions & Comments
Leave a comment
Log-in now or register for a free account.
3 weeks ago
3 weeks ago
1 month ago
3 months ago