Skip to content

MesQ is a PHP lite disk based message queue manager

License

Notifications You must be signed in to change notification settings

iCalcreator/MesQ

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MesQ

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.

About

MesQ is a PHP lite disk based message queue manager

Resources

License

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published