dev-master
9999999-devJobQueue for Magento using DJJob
MIT
The Requires
- php >=5.1
- elvetemedve/djjob ~1.0.0
by Jordan Owens
0.5.0
0.5.0.0JobQueue for Magento using DJJob
MIT
The Requires
- php >=5.1
- elvetemedve/djjob ~1.0.0
by Jordan Owens
Wallogit.com
2017 © Pedro Peláez
JobQueue for Magento using DJJob
Do you need to run a process outside of a user generated request? Are you working on an integration that requires "guaranteed delivery"? JobQueue allows Magento applications to place tasks in a queue to be processed asynchronously. It is built on DJJob and makes use of the existing MySQL backend. Some tasks this may be ideal for are:, (*1)
Jobs must extend Jowens_JobQueue_Model_Job_Abstract and implement the perform() method., (*2)
class Foo_Bar_Model_Order_Job extends Jowens_JobQueue_Model_Job_Abstract
{
public function perform() {
// implementation logic
}
}
That job can then be used like so:, (*3)
$job = Mage::getModel('bar/order_job');
$job->setName('Order# 12345')
->enqueue();
Name is used to identify the job in backend, so be descriptive! The enqueue method can take two optional parameters, a string for queue name and timestamp to specify a time to run the job., (*4)
The job can also be attempted immediately. If it fails it is added to the default queue for retry., (*5)
$job = Mage::getModel('bar/order_job');
$job->setName('Order# 12345')
->performImmediate();
To put the job on a queue other than the default one, performImmediate takes an optional string value for the name of the retry queue., (*6)
JobQueue requires Magento cron to be configured in order to run pending jobs. By default a JobQueue worker executes the pending jobs every 5 minutes. If a job fails it will be retried up to 10 times. Both of these settings can be configured in the admin panel under System > Configuration > General > JobQueue., (*7)
Jobs in other queues can be executed by adding more cron entries to a custom module config.xml., (*8)
<crontab>
<jobs>
<jobqueue_orders>
<schedule>
<config_path>jobqueue/config/cron_expr</config_path>
</schedule>
<run>
<model>jobqueue/worker::executeJobs</model>
</run>
<queue>orders</queue>
</jobqueue_orders>
</jobs>
</crontab>
Alternatively workers could be configured to run as they normally would using DJJob. See the documentation., (*9)
Pending and failed jobs can be monitored in the admin panel by going to System > JobQueue., (*10)
JobQueue for Magento using DJJob
MIT
JobQueue for Magento using DJJob
MIT