Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.2.x will end 22 April 2024 (12 months).
  • Bug fixes for security issues in 4.2.x will end 7 October 2024 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.1.x is supported too.

Differences Between: [Versions 310 and 402] [Versions 311 and 402] [Versions 39 and 402] [Versions 400 and 402] [Versions 401 and 402]

Abstract class for common properties of scheduled_task and adhoc_task.

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

Defines 2 classes

task_base:: (10 methods):
  set_lock()
  set_cron_lock()
  get_lock()
  get_next_run_time()
  set_next_run_time()
  get_cron_lock()
  set_blocking()
  is_blocking()
  set_component()
  get_component()

namespace:: (11 methods):
  set_fail_delay()
  get_fail_delay()
  set_timestarted()
  get_timestarted()
  set_hostname()
  get_hostname()
  set_pid()
  get_pid()
  is_component_enabled()
  get_runtime()
  get_runtime_result()


Class: task_base  - X-Ref

Abstract class for common properties of scheduled_task and adhoc_task.

set_lock(\core\lock\lock $lock)   X-Ref
Set the current lock for this task.

param: \core\lock\lock $lock

set_cron_lock(\core\lock\lock $lock)   X-Ref
Set the current lock for the entire cron process.

param: \core\lock\lock $lock

get_lock()   X-Ref
Get the current lock for this task.

return: \core\lock\lock

get_next_run_time()   X-Ref
Get the next run time for this task.

return: int timestamp

set_next_run_time($nextruntime)   X-Ref
Set the next run time for this task.

param: int $nextruntime

get_cron_lock()   X-Ref
Get the current lock for the entire cron.

return: \core\lock\lock

set_blocking($blocking)   X-Ref
Setter for $blocking.

param: bool $blocking

is_blocking()   X-Ref
Getter for $blocking.

return: bool

set_component($component)   X-Ref
Setter for $component.

param: string $component

get_component()   X-Ref
Getter for $component.

return: string

Class: namespace  - X-Ref

set_fail_delay($faildelay)   X-Ref
Setter for $faildelay.

param: int $faildelay

get_fail_delay()   X-Ref
Getter for $faildelay.

return: int

set_timestarted($timestarted = null)   X-Ref
Setter for $timestarted.

param: int $timestarted

get_timestarted()   X-Ref
Getter for $timestarted.

return: int

set_hostname($hostname = null)   X-Ref
Setter for $hostname.

param: string $hostname

get_hostname()   X-Ref
Getter for $hostname.

return: string

set_pid($pid = null)   X-Ref
Setter for $pid.

param: int $pid

get_pid()   X-Ref
Getter for $pid.

return: int

is_component_enabled()   X-Ref
Informs whether the task's component is enabled.

return: bool true when enabled. false otherwise.

get_runtime()   X-Ref
Returns task runtime

return: int

get_runtime_result()   X-Ref
Returns if the task has been running for too long

return: result