Download the PHP package oat-sa/extension-tao-scheduler without Composer
On this page you can find all versions of the php package oat-sa/extension-tao-scheduler. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download oat-sa/extension-tao-scheduler
More information about oat-sa/extension-tao-scheduler
Files in oat-sa/extension-tao-scheduler
Package extension-tao-scheduler
Short Description TAO job scheduler
License GPL-2.0-only
Homepage http://www.taotesting.com
Informations about the package extension-tao-scheduler
Tao task scheduler
RRULE standard is used to configure time and recurrence rule of each job.
Install
Usage
attach a job:
Also cron notation may be used:
Note:
You can use any instance of callable type as callback except functions. In case if object is used ([$object, 'method']) make sure that object is instance of
PhpSerializable
.
Class name ofoat\oatbox\action\Action
instance may be used as a callback
detach a job:
All given parameters to detach
function should be the same as in existing job.
Run JobRunner
- First parameter is a timestamp from which scheduler should start to look up scheduled tasks. All the tasks scheduled before this time will be ignored.
Note:
Scheduled tasks may be executed even if their start date is later than timestamp given to job runner because they may be recurred and their start date is just a time of the first occurrence
If this parameter is omitted or less than 0 then start time will be taken from the storage (time of last seeking of scheduled job or time of last job runner iteration).
If there is no last iteration time in the storage current timestamp will be used.
- Second parameter is time between Job Runner iterations. Default value is 60 seconds. This time may be longer than configured because execution of tasks found during current iteration may take some time.
Discover tasks to be run
Remove expired jobs from job storage (jobs which will not be executed anymore after given date):
- First parameter is dryrun mode.
false
by default. - Second parameter is time since which helper will try to find expired jobs (including given time). If parameter was not given then the last launch time of job runner will be used.
To run tasks through the task queue you may use \oat\taoTaskQueue\scripts\tools\AddTaskToQueue
action.
Note:
taoScheduler does not require taoTaskQueue extension. Make sure that task queue is installed.
Warnings
- Configure JobRunner service with common rds storage in case if scheduler is going to be run on multiserver environment.
- Please do not schedule tasks which execution of which requires a lot of resource or take long time. All the time/resources consuming tasks should create appropriate tasks in the task queue. Ideally scheduled tasks should do nothing except adding tasks to the task queue.
- Use cron syntax in case if number of occurrences is not limited.
- iCalendar syntax is more flexible but in case of large or unlimited number of repeats there may be performance issues. By default limit of repeats is 732. More information: https://github.com/simshaun/recurr
All versions of extension-tao-scheduler with dependencies
hutnikau/job-scheduler Version ~0.6.1
oat-sa/generis Version >=15.22
oat-sa/tao-core Version >=50.24.6