PHP code example of hidalgo-rides / intersect-queue

1. Go to this page and download the library: Download hidalgo-rides/intersect-queue 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/ */

    

hidalgo-rides / intersect-queue example snippets




class SampleProcessor implements \Intersect\Queue\QueueProcessor {
    
    public function getFrequency()
    {
        // every five minutes
        return '*/5 * * * *';
    }

    public function process()
    {
        // do custom things here like query database records to
        // perform actions, update stats, or whatever you want
    }
    
}



// initialize QueueManager
$queueManager = new \Intersect\Queue\QueueManager();

// register processor
$queueManager->registerProcessor(new SampleProcessor());

// run QueueManager
$queueManager->run();

* * * * * php /path/to/queue/manager/script.php >> /dev/null 2>&1