QueueZilla
QueueZilla is a simple framework that enables you to write MySQL queue consumers quickly and neatly. It enforces key methods via an interface
so you can write clean code, (*1)
Installation
Run composer require fobilow/queuezilla 1.* or add "fobilow/queuezilla" :"1.*" to your composer.json., (*2)
Usage
You will need to create a consumer class that extends the MySQLQueueConsumer e.g MyConsumer and implement the following methods
- getLockedJob();
- getNewJob();
- doJob();
- completeJob();
- takeABreak(), (*3)
Then in your CLI script or calling script you call it like this, (*4)
use QueueZilla\Framework\Queue\MySQLQueueConsumer;
$queueConsumer = new MyConsumer();
$queueConsumer->setProcessId('someId'); //maybe a combination of hostname
$queueConsumer->consume();
Contributing
If you find a bug or want to improve the code in any way, please submit a pull request, (*5)
Failing that, just create an issue with the bug you have found, and I'll take it from there :), (*6)