I am trying to implement a Queue for my cron job, but some how it is not working. Following is the code snippet I have tried, but it is not working.
function hook_cron() {
watchdog('notice', 'Cron is executed');
$queue = DrupalQueue::get('update_item');
for($i=0;$i<=10;$i++){
$queue->createItem($i);
}
}
function hook_cron_queue_info() {
watchdog('notice', 'called queue info');
$queues['update_item'] = array(
'worker callback' => '_my_queue_callback',
'time' => 15,
);
return $queues;
}
function _my_queue_callback($data){
watchdog('notice', "Queue call back $data");
}
Following output I am expecting in logs "Cron is executed" "Called queue info" and "Queue call back 1"..."Queue call back 10"
But I am only getting
"Cron is executed"
I am runing the cron using elysia_cron interface (in my linux box cron job is not added in crontab). What might be the reason I am not getting "Called queue info" and "Queue call back 1"..."Queue call back 10" in my logs.