kigkonsult / mesq
PHP lite disk based message queue manager
Fund package maintenance!
Other
Requires
- php: >=8.0
Requires (Dev)
- phpstan/phpstan: >=0.9.3
README
About
MesQ is a PHP lite disk based message queue manager
- Assemple and enqueue (un-)frequently (incoming) messages
- dequeue once (scheduled?)
MesQ supports FIFO, LIFO and PRIOrity message queues
Message can be any of scalar, array or object types
Usage
Requires (below)
- unique <queueName>
- existing read-/writeable <directory>
For the MesQ config keys, please review src/MesQinterface.php.
Add messages to queue
<?php namespace Kigkonsult\MesQ; require 'vendor/autoload.php'; ... $config = [ MesQ::QUEUENAME => <queueName>, MesQ::DIRECTORY => <directory>, MesQ::QUEUETYPE => MesQ::FIFO, // default ]; MesQ::factory( $config ) ->push( <message> ); ...
Process queued messages
<?php namespace Kigkonsult\MesQ; require 'vendor/autoload.php'; ... $config = [ MesQ::QUEUENAME => <queueName>, MesQ::DIRECTORY => <directory>, MesQ::RETURNCHUNKSIZE => 1000 ]; $mesQ = MesQ::factory( $config ); if( $mesQ->messageExists() { while( $message = $mesQ->getMessage()) { ... // process message, max 1000 ... } // end while } // end if ...
For more detailed usage, read MesQ docs.
Installation
Composer, from the Command Line:
composer require kigkonsult/mesq
In your composer.json:
{ "require": { "kigkonsult/mesq": "dev-master" } }
Version 1.6 supports PHP 8.0, 1.4 7.4, 1.2 7.0.
Sponsorship
Donation using paypal.me/kigkonsult are appreciated. For invoice, e-mail.
Licence
MesQ is licensed under the LGPLv3 License.