function drush_queue_list

8.0.x queue.drush.inc drush_queue_list()
6.x queue.drush.inc drush_queue_list()
7.x queue.drush.inc drush_queue_list()
5.x queue.drush.inc drush_queue_list()
master queue.drush.inc drush_queue_list()

Command callback for drush queue-list.

File

commands/core/queue.drush.inc, line 105

Code

function drush_queue_list() {
  $queues = drush_queue_get_queues();
  $default_class = variable_get('queue_default_class', 'SystemQueue');
  $rows = array(array('Queue', 'Items', 'Class'));
  foreach (array_keys($queues) as $name) {
    $q = DrupalQueue::get($name);
    $class = variable_get('queue_class_' . $name, $default_class);
    $rows[] = array($name, $q->numberOfItems(), $class);
  }

  if (drush_get_option('pipe')) {
    $pipe = array();
    array_shift($rows);
    foreach ($rows as $r) {
      $pipe[] = implode(",", $r);
    }
    drush_print_pipe($pipe);
  }
  else {
    drush_print_table($rows, TRUE);
  }

  // Return the result for backend invoke
  return $rows;
}