Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
Public Member Functions | Protected Member Functions | List of all members
core\task\adhoc_task Class Reference

Abstract class defining an adhoc task. More...

Inheritance diagram for core\task\adhoc_task:
core\task\task_base core\task\asynchronous_backup_task core\task\asynchronous_copy_task core\task\asynchronous_restore_task core\task\build_installed_themes_task core\task\calendar_fix_orphaned_events core\task\clean_up_deleted_search_area_task core\task\course_backup_task core\task\refresh_mod_calendar_events_task core_course\task\course_delete_modules core_message\task\migrate_message_data mod_forum\task\refresh_forum_post_counts mod_forum\task\send_user_digests mod_forum\task\send_user_notifications tool_dataprivacy\task\process_data_request_task tool_monitor\notification_task

Public Member Functions

 execute ()
 Do the job. More...
 
 get_component ()
 Getter for $component. More...
 
 get_concurrency_limit ()
 Returns effective concurrency limit for this task. More...
 
 get_cron_lock ()
 Get the current lock for the entire cron. More...
 
 get_custom_data ()
 Getter for $customdata. More...
 
 get_custom_data_as_string ()
 Alternate getter for $customdata. More...
 
 get_fail_delay ()
 Getter for $faildelay. More...
 
 get_id ()
 Getter for $id. More...
 
 get_lock ()
 Get the current lock for this task. More...
 
 get_next_run_time ()
 Get the next run time for this task. More...
 
 get_userid ()
 Getter for $userid. More...
 
 is_blocking ()
 Getter for $blocking. More...
 
 release_concurrency_lock ()
 Release the concurrency lock for this task type.
 
 set_blocking ($blocking)
 Setter for $blocking. More...
 
 set_component ($component)
 Setter for $component. More...
 
 set_concurrency_lock (\core\lock\lock $lock)
 Sets concurrency task lock. More...
 
 set_cron_lock (\core\lock\lock $lock)
 Set the current lock for the entire cron process. More...
 
 set_custom_data ($customdata)
 Setter for $customdata. More...
 
 set_custom_data_as_string ($customdata)
 Alternate setter for $customdata. More...
 
 set_fail_delay ($faildelay)
 Setter for $faildelay. More...
 
 set_id ($id)
 Setter for $id. More...
 
 set_lock (\core\lock\lock $lock)
 Set the current lock for this task. More...
 
 set_next_run_time ($nextruntime)
 Set the next run time for this task. More...
 
 set_userid ($userid)
 Setter for $userid. More...
 

Protected Member Functions

 get_default_concurrency_limit ()
 Returns default concurrency limit for this task. More...
 

Detailed Description

Abstract class defining an adhoc task.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Member Function Documentation

◆ execute()

core\task\task_base::execute ( )
abstractinherited

Do the job.

Throw exceptions on errors (the job will be retried).

Reimplemented in tool_analytics\task\predict_models, tool_analytics\task\train_models, tool_cohortroles\task\cohort_role_sync, tool_dataprivacy\task\delete_existing_deleted_users, tool_dataprivacy\task\delete_expired_contexts, tool_dataprivacy\task\delete_expired_requests, tool_dataprivacy\task\expired_retention_period, tool_dataprivacy\task\process_data_request_task, tool_langimport\task\update_langpacks_task, logstore_legacy\task\cleanup_task, logstore_standard\task\cleanup_task, tool_messageinbound\task\cleanup_task, tool_messageinbound\task\pickup_task, tool_monitor\notification_task, tool_monitor\task\check_subscriptions, tool_monitor\task\clean_events, tool_recyclebin\task\cleanup_category_bin, tool_recyclebin\task\cleanup_course_bin, auth_cas\task\sync_task, auth_db\task\sync_users, auth_ldap\task\sync_roles, auth_ldap\task\sync_task, auth_mnet\task\cron_task, block_recent_activity\task\cleanup, block_rss_client\task\refreshfeeds, core_course\task\course_delete_modules, enrol_category\task\enrol_category_sync, enrol_cohort\task\enrol_cohort_sync, enrol_database\task\sync_enrolments, enrol_flatfile\task\flatfile_sync_task, enrol_imsenterprise\task\cron_task, enrol_ldap\task\sync_enrolments, enrol_lti\task\sync_grades, enrol_lti\task\sync_members, enrol_manual\task\send_expiry_notifications, enrol_manual\task\sync_enrolments, enrol_meta\task\enrol_meta_sync, enrol_paypal\task\process_expirations, enrol_self\task\send_expiry_notifications, enrol_self\task\sync_enrolments, core_files\task\conversion_cleanup_task, core\oauth2\refresh_system_tokens_task, core\task\analytics_cleanup_task, core\task\asynchronous_backup_task, core\task\asynchronous_copy_task, core\task\asynchronous_restore_task, core\task\automated_backup_task, core\task\backup_cleanup_task, core\task\badges_cron_task, core\task\badges_message_task, core\task\blog_cron_task, core\task\build_installed_themes_task, core\task\cache_cleanup_task, core\task\cache_cron_task, core\task\calendar_cron_task, core\task\calendar_fix_orphaned_events, core\task\check_for_updates_task, core\task\clean_up_deleted_search_area_task, core\task\complete_plans_task, core\task\completion_daily_task, core\task\completion_regular_task, core\task\context_cleanup_task, core\task\course_backup_task, core\task\create_contexts_task, core\task\delete_incomplete_users_task, core\task\delete_unconfirmed_users_task, core\task\file_temp_cleanup_task, core\task\file_trash_cleanup_task, core\task\grade_cron_task, core\task\grade_history_cleanup_task, core\task\h5p_get_content_types_task, core\task\legacy_plugin_cron_task, core\task\messaging_cleanup_task, core\task\password_reset_cleanup_task, core\task\plagiarism_cron_task, core\task\portfolio_cron_task, core\task\question_preview_cleanup_task, core\task\question_stats_cleanup_task, core\task\refresh_mod_calendar_events_task, core\task\registration_cron_task, core\task\search_index_task, core\task\search_optimize_task, core\task\send_failed_login_notifications_task, core\task\send_new_user_passwords_task, core\task\session_cleanup_task, core\task\stats_cron_task, core\task\sync_plans_from_template_cohorts_task, core\task\tag_cron_task, core\task\task_log_cleanup_task, editor_atto\task\autosave_cleanup_task, core_message\task\migrate_message_data, message_email\task\send_email_task, mod_assign\task\cron_task, assignfeedback_editpdf\task\convert_submissions, mod_chat\task\cron_task, mod_forum\task\cron_task, mod_forum\task\refresh_forum_post_counts, mod_forum\task\send_user_digests, mod_forum\task\send_user_notifications, mod_lti\task\clean_access_tokens, ltiservice_gradebookservices\task\cleanup_task, mod_quiz\task\legacy_quiz_accessrules_cron, mod_quiz\task\legacy_quiz_reports_cron, mod_quiz\task\update_overdue_attempts, quiz_statistics\task\quiz_statistics_cleanup, mod_scorm\task\cron_task, workshopallocation_scheduled\task\cron_task, mod_workshop\task\cron_task, mod_workshop\task\legacy_workshop_allocation_cron, qtype_random\task\remove_unused_questions, repository_dropbox\task\cron_task, repository_filesystem\task\cron_task, and repository_onedrive\remove_temp_access_task.

◆ get_component()

core\task\task_base::get_component ( )
inherited

Getter for $component.

Return values
string

◆ get_concurrency_limit()

core\task\adhoc_task::get_concurrency_limit ( )
final

Returns effective concurrency limit for this task.

Return values
inteffective concurrency limit for this task

◆ get_cron_lock()

core\task\task_base::get_cron_lock ( )
inherited

Get the current lock for the entire cron.

Return values
core::lock::lock

◆ get_custom_data()

core\task\adhoc_task::get_custom_data ( )

Getter for $customdata.

Return values
mixed(anything that can be handled by json_decode).

◆ get_custom_data_as_string()

core\task\adhoc_task::get_custom_data_as_string ( )

Alternate getter for $customdata.

Return values
stringthis is the raw json encoded version.

◆ get_default_concurrency_limit()

core\task\adhoc_task::get_default_concurrency_limit ( )
protected

Returns default concurrency limit for this task.

Return values
intdefault concurrency limit

◆ get_fail_delay()

core\task\task_base::get_fail_delay ( )
inherited

Getter for $faildelay.

Return values
int

◆ get_id()

core\task\adhoc_task::get_id ( )

Getter for $id.

Return values
int|null::$id

◆ get_lock()

core\task\task_base::get_lock ( )
inherited

Get the current lock for this task.

Return values
core::lock::lock

◆ get_next_run_time()

core\task\task_base::get_next_run_time ( )
inherited

Get the next run time for this task.

Return values
inttimestamp

◆ get_userid()

core\task\adhoc_task::get_userid ( )

Getter for $userid.

Return values
int|null::$userid

◆ is_blocking()

core\task\task_base::is_blocking ( )
inherited

Getter for $blocking.

Return values
bool

◆ set_blocking()

core\task\task_base::set_blocking (   $blocking)
inherited

Setter for $blocking.

Parameters
bool$blocking

◆ set_component()

core\task\task_base::set_component (   $component)
inherited

Setter for $component.

Parameters
string$component

◆ set_concurrency_lock()

core\task\adhoc_task::set_concurrency_lock ( \core\lock\lock  $lock)
final

Sets concurrency task lock.

Parameters
core::lock::lock$lockconcurrency lock to be set

◆ set_cron_lock()

core\task\task_base::set_cron_lock ( \core\lock\lock  $lock)
inherited

Set the current lock for the entire cron process.

Parameters
core::lock::lock$lock

◆ set_custom_data()

core\task\adhoc_task::set_custom_data (   $customdata)

Setter for $customdata.

Parameters
mixed$customdata(anything that can be handled by json_encode)

◆ set_custom_data_as_string()

core\task\adhoc_task::set_custom_data_as_string (   $customdata)

Alternate setter for $customdata.

Expects the data as a json_encoded string.

Parameters
string$customdatajson_encoded string

◆ set_fail_delay()

core\task\task_base::set_fail_delay (   $faildelay)
inherited

Setter for $faildelay.

Parameters
int$faildelay

◆ set_id()

core\task\adhoc_task::set_id (   $id)

Setter for $id.

Parameters
int | null$id

◆ set_lock()

core\task\task_base::set_lock ( \core\lock\lock  $lock)
inherited

Set the current lock for this task.

Parameters
core::lock::lock$lock

◆ set_next_run_time()

core\task\task_base::set_next_run_time (   $nextruntime)
inherited

Set the next run time for this task.

Parameters
int$nextruntime

◆ set_userid()

core\task\adhoc_task::set_userid (   $userid)

Setter for $userid.

Parameters
int | null$userid

The documentation for this class was generated from the following file: