AOEpeople/Aoe_Queue

Name: Aoe_Queue

Owner: AOE

Description: Queue implementation for Magento based on Zend Queue

Created: 2012-11-07 21:19:26.0

Updated: 2018-01-10 12:58:43.0

Pushed: 2017-05-02 20:16:22.0

Homepage: null

Size: 39

Language: PHP

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Aoe_Queue

How to run unit tests
cd <MagentoDocRoot>

# Get phpunit
wget http://pear.phpunit.de/get/phpunit.phar
chmod +x phpunit.phar

# Run tests
./phpunit.phar tests/Aoe_Queue/QueueTestcase.php
Adding a task to the queue
$queue = Mage::getModel('aoe_queue/queue'); /* @var $queue Aoe_Queue_Model_Queue */
$queue->addTask('aoe_queue/dummy::test', array('-+', '5'));
Processing the queue
$queue = Mage::getModel('aoe_queue/queue'); /* @var $queue Aoe_Queue_Model_Queue */
$messages = $queue->receive(5); /* @var $messages Zend_Queue_Message_Iterator */
foreach ($messages as $message) { /* @var $message Aoe_Queue_Model_Message */
    $message->execute();
}
Cron configuration
In System > Configuration > Advanced > System > Queue

Use Aoe_Scheduler to run a separate cronjob to process the aoe_queue task so this won't block the other tasks.

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.