Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Differences Between: [Versions 311 and 401] [Versions 38 and 311]

Adhoc task abstract class. All background tasks should extend this class.

Copyright: 2013 Damyon Wiese
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 160 lines (4 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: adhoc_task  - X-Ref

Abstract class defining an adhoc task.

set_id($id)   X-Ref
Setter for $id.

param: int|null $id

get_userid()   X-Ref
Getter for $userid.

return: int|null $userid

set_custom_data($customdata)   X-Ref
Setter for $customdata.

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

set_custom_data_as_string($customdata)   X-Ref
Alternate setter for $customdata. Expects the data as a json_encoded string.

param: string $customdata json_encoded string

get_custom_data()   X-Ref
Getter for $customdata.

return: mixed (anything that can be handled by json_decode).

get_custom_data_as_string()   X-Ref
Alternate getter for $customdata.

return: string this is the raw json encoded version.

get_id()   X-Ref
Getter for $id.

return: int|null $id

set_userid($userid)   X-Ref
Setter for $userid.

param: int|null $userid

get_default_concurrency_limit()   X-Ref
Returns default concurrency limit for this task.

return: int default concurrency limit

get_concurrency_limit()   X-Ref
Returns effective concurrency limit for this task.

return: int effective concurrency limit for this task

set_concurrency_lock(\core\lock\lock $lock)   X-Ref
Sets concurrency task lock.

param: \core\lock\lock $lock concurrency lock to be set

release_concurrency_lock()   X-Ref
Release the concurrency lock for this task type.