How to process more than one item from queue in each run? I have set up a queue using:

  function custom_logger_cron_queue_info()
  {
    $queues['custom_logger'] = array(
      'worker callback' =&gt; 'custom_logger_import',
      'time' =&gt; 60,
    );
    return $queues;
  }


Which I add items to using:

$item = array('uri' =&gt; $uri, 'uid' =&gt; $uid, 'fid' =&gt; $fid);
$queue = DrupalQueue::get('custom_logger');
$queue-&gt;createItem($item);


Which is working great, except that when cron runs every minute for this queue (I am using ultimate_cron module to set this) the custom_logger_import function is only processing one item per run. At present I have the function simply set up as:

function custom_logger_import($item) {
    $uri = $item['uri'];
    $uid = $item['uid'];
    $fid = $item['fid'];
//Do some stuff
}


Is there something I am missing on ensuring that as many items as possible get run? They are only small jobs that complete in less than a couple seconds but at the moment its taking 3-4 minutes to process just 3 items.

UPDATE:

The problem was actually in my function that was being called. I was using non-drupal friendly sql which seemed to prevent the job being done more than once. After updating all the database related stuff to drupal friendly database extraction layer stuff, it all works fine. For the record, here is a good way of checking that everything is running fine with the queues. Comment out your function being called by the queue and add this in replacement:

$file = '/somepath/hello.txt';
$current = file_get_contents($file);
$current .= $item['some variable from your queue item'] . " Hello\n";
file_put_contents($file, $current);


Then, when the queue is processed at cron, it should print out each of your queue items variable followed by hello to a text file.
The queue system is designed to process items until the time is up. Maybe it's a bug in Ultime Cron? Try running the default core cron.php to verify that.

Are you sure that you're actually adding multiple items to be processed? Check 
your queue table.