Implements lazy scheduling behavior supported by com_ajax backed AJAX requests instead of being executed at the end of each regular response. The JavaScript is injected into all site site responses with an HTML context.
This change entirely removes the shutdown_function behavior in favor of this new method. The scheduler will still be trigger-able by regular requests to a site endpoint ending with parameters ?option=com_ajax&plugin=runScheduler&group=system&format=raw&scheduler_hash=xyz, where the scheduler_hash parameter is only needed if the Scheduler is protected with a hash. I think this should be documented somewhere in the Scheduler backend interface, probably in on the configuration form.
Tasks
[x] JavaScript for AJAX requests.
[x] A scheduleRunner event lister as JavaScript injector.
[x] Listener to run the scheduler on related com_ajax event.
[x] Add interval configuration to com_scheduler and add as script option.
Testing Instructions
Load a regular page on site. Performance should not be impacted visually or otherwise even with long running scheduled tasks. This should be verified with the log from joomla_scheduler.php.
Actual result BEFORE applying this Pull Request
Scheduler is triggered at the end of each site response. This should be apparent especially with long running tasks which will cause the browser to indicate an ongoing load.
Expected result AFTER applying this Pull Request
Scheduler is now triggered by AJAX calls from the browser at a regular interval. This is 5 minutes at the moment.
Pull Request for Issue #19.
Summary of Changes
Implements lazy scheduling behavior supported by
com_ajax
backed AJAX requests instead of being executed at the end of each regular response. The JavaScript is injected into all site site responses with an HTML context. This change entirely removes theshutdown_function
behavior in favor of this new method. The scheduler will still be trigger-able by regular requests to a site endpoint ending with parameters?option=com_ajax&plugin=runScheduler&group=system&format=raw&scheduler_hash=xyz
, where thescheduler_hash
parameter is only needed if the Scheduler is protected with a hash. I think this should be documented somewhere in the Scheduler backend interface, probably in on the configuration form.Tasks
com_ajax
event.com_scheduler
and add as script option.Testing Instructions
Load a regular page on site. Performance should not be impacted visually or otherwise even with long running scheduled tasks. This should be verified with the log from
joomla_scheduler.php
.Actual result BEFORE applying this Pull Request
Scheduler is triggered at the end of each site response. This should be apparent especially with long running tasks which will cause the browser to indicate an ongoing load.
Expected result AFTER applying this Pull Request
Scheduler is now triggered by AJAX calls from the browser at a regular interval. This is 5 minutes at the moment.
Documentation Changes Required