You are here

function hook_advanced_queue_info in Advanced Queue 7

Declare queue(s) that will be run by Advanced queue.

Return value

array Queue definitions.

See also

advancedqueue_example_worker()

2 functions implement hook_advanced_queue_info()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

advancedqueue_example_advanced_queue_info in advancedqueue_example/advancedqueue_example.module
Implements hook_advanced_queue_info().
advancedqueue_test_advanced_queue_info in tests/advancedqueue_test.module
Implements hook_advanced_queue_info().
2 invocations of hook_advanced_queue_info()
advancedqueue_get_queues_info in ./advancedqueue.module
Return queue(s) info.
drush_advancedqueue_get_queues in drush/advancedqueue.drush.inc
Get queues defined with hook_advanced_queue_info().

File

./advancedqueue.api.php, line 16
Hooks provided by the Advanced queue module.

Code

function hook_advanced_queue_info() {
  $queue_info['example_queue'] = array(
    'label' => t('Example queue'),
    'worker callback' => 'advancedqueue_example_worker',
    // Supply arguments for module_load_include() to load a file for the
    // worker callback.
    'worker include' => array(
      'inc',
      'advancedqueue_example',
      'advancedqueue_example.worker',
    ),
    // A list of groups to "tag" this queue with so that various queues
    // can be grouped for execution by particular Drush commands.
    'groups' => array(
      'example',
      'high_priority',
    ),
    'delete when completed' => TRUE,
    // The number of seconds to retry after.
    'retry after' => 10,
    // The maximum number of attempts after a failure.
    'max attempts' => 5,
    // The time an item is leased for before it expires and is requeued.
    // Defaults to 30.
    'lease time' => 30,
    // Queues are weighted and all items in a lighter queue are processed
    // before queues with heavier weights. Defaults to 0.
    'weight' => 10,
    // All queue items normally fire a pre- and post-execute hook. Queues
    // which enable (set to TRUE) this setting avoid this.
    'skip hooks' => FALSE,
  );
  return $queue_info;
}