This is my first time using the DrupalQueue class, and I have two questions.
Does hook_cron_queue_info() HAVE to go in my mymodule.module file? I had some weird behavior before finally trying that, and it seems to be the culprit.
Can I put the queue worker callback in a separate file? I'm trying to keep all my queue functions in their own file, but it doesn't seem like I can do a file attribute like with a lot of other callback types; I just keep getting function undefined errors.
I tried...
function mymodule_cron_queue_info() {
$queues['autopilot'] = array(
'time' => 60,
'worker callback' => '_mymodule_queue_handler',
'file' => array('type' => 'inc', 'module' => 'mymodule', 'name' => 'includes/mymodule.queue'),
);
return $queues;
}
and
function mymodule_cron_queue_info() {
module_load_include('module', 'mymodule', 'includes/mymodule.queue.inc');
$queues['autopilot'] = array(
'time' => 60,
'worker callback' => '_mymodule_queue_handler',
);
return $queues;
}
but neither seem to work.