function hook_cron_job_scheduler_info in Job Scheduler 8.2
Same name and namespace in other branches
- 8.3 job_scheduler.api.php \hook_cron_job_scheduler_info()
- 7.2 job_scheduler.api.php \hook_cron_job_scheduler_info()
- 7 job_scheduler.api.php \hook_cron_job_scheduler_info()
Declare job scheduling holding items that need to be run periodically.
Return value
array 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()
- job_scheduler_info in ./
job_scheduler.module - Collects and returns scheduler info.
File
- ./
job_scheduler.api.php, line 24 - API documentation for hooks.
Code
function hook_cron_job_scheduler_info() {
$info = [];
$info['example_reset'] = [
'worker callback' => 'example_cache_clear_worker',
];
$info['example_import'] = [
'worker callback' => 'example_import_worker',
'queue name' => 'example_import_queue',
];
return $info;
}