function hosting_QUEUE_TYPE_queue

7.x-3.x hosting.api.php hosting_QUEUE_TYPE_queue($count = 5)

Process the specified queue.

Modules providing a queue should implement this function an process the number of items from the queue that are specified. It is up the to the module to determine which items it wishes to process.

If you wish to process multiple items at the same time you will need to fork the process by calling drush_invoke_process() with the 'fork' option, specifying a drush command with the arguments required to process your task. Otherwise you can do all your processing in this function, or similarly call drush_invoke_process() without the 'fork' option.


int $count: The maximum number of items to process.

See also



Related topics


./hosting.api.php, line 310
Hooks provided by the hosting module, and some other random ones.


function hosting_QUEUE_TYPE_queue($count = 5) {
  // From hosting_tasks_queue().
  global $provision_errors;

  drush_log(dt("Running tasks queue"));
  $tasks = _hosting_get_new_tasks($count);
  foreach ($tasks as $task) {
    drush_invoke_process('@self', "hosting-task", array($task->nid), array(), array('fork' => TRUE));