PHP code example of kigkonsult / mesq

1. Go to this page and download the library: Download kigkonsult/mesq library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

kigkonsult / mesq example snippets

 php

namespace Kigkonsult\MesQ;

=> <queueName>,
    MesQ::DIRECTORY => <directory>,
    MesQ::QUEUETYPE => MesQ::FIFO, // default
];

MesQ::factory( $config )
    ->push( <message> );
...
 php

namespace Kigkonsult\MesQ;

      => <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

...