You are here

function hook_cron_job_scheduler_info in Job Scheduler 7

Same name and namespace in other branches
  1. 8.3 job_scheduler.api.php \hook_cron_job_scheduler_info()
  2. 8.2 job_scheduler.api.php \hook_cron_job_scheduler_info()
  3. 7.2 job_scheduler.api.php \hook_cron_job_scheduler_info()

Declare job scheduling holding items that need to be run periodically.

Return value

An associative array where the key is the queue name and the value is again an associative array. Possible keys are:

  • 'worker callback': The name of the function to call. It will be called at schedule time.
  • 'queue name': The name of the queue to use to queue this task. Must contain a valid queue name, declared by hook_cron_queue_info().

If queue name is given, worker callback will be ignored.

See also

hook_cron_job_scheduler_info_alter()

hook_cron_queue_info()

hook_cron_queue_info_alter()

1 invocation of hook_cron_job_scheduler_info()
JobScheduler::info in ./JobScheduler.inc
Returns scheduler info.

File

./job_scheduler.api.php, line 24
API documentation for hooks.

Code

function hook_cron_job_scheduler_info() {
  $info = array();
  $info['example_reset'] = array(
    'worker callback' => 'example_cache_clear_worker',
  );
  $info['example_import'] = array(
    'queue name' => 'example_import_queue',
  );
  return $info;
}