PHP code example of hirale / openmage-redis-queue

1. Go to this page and download the library: Download hirale/openmage-redis-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/ */

    

hirale / openmage-redis-queue example snippets


    
        class Hirale_QueueExample_Model_TestHandler implements Hirale_Queue_Model_TaskHandlerInterface
        {

            public function handle($data)
            {
                Mage::log($data['id'] . ': ' . print_r($data, true), Zend_Log::INFO, 'example.log');
            }
        }
    

    
        class Hirale_QueueExample_Model_Observer
        {
            public function testExample(Varien_Event_Observer $observer)
            {
                $currentRoute = $observer->getEvent()->getFront();
                Mage::getModel('hirale_queue/task')->addTask('Hirale_QueueExample_Model_TestHandler',
                ['route' => $currentRoute->getRequest()->getRequestString()]);
            }
        }