projects
/
roojs1
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix #6913 - add more documentation to code
[roojs1]
/
Roo
/
util
/
TaskRunner.js
diff --git
a/Roo/util/TaskRunner.js
b/Roo/util/TaskRunner.js
index
bc8ece8
..
a95218d
100644
(file)
--- a/
Roo/util/TaskRunner.js
+++ b/
Roo/util/TaskRunner.js
@@
-8,7
+8,12
@@
* Fork - LGPL
* <script type="text/javascript">
*/
* Fork - LGPL
* <script type="text/javascript">
*/
-
+/**
+ * @class Roo.util.TaskRunner
+ * Manage background tasks - not sure why this is better that setInterval?
+ * @static
+ *
+ */
Roo.util.TaskRunner = function(interval){
interval = interval || 10;
Roo.util.TaskRunner = function(interval){
interval = interval || 10;
@@
-68,6
+73,12
@@
Roo.util.TaskRunner = function(interval){
/**
* Queues a new task.
* @param {Object} task
/**
* Queues a new task.
* @param {Object} task
+ *
+ * Task property : interval = how frequent to run.
+ * Task object should implement
+ * function run()
+ * Task object may implement
+ * function onStop()
*/
this.start = function(task){
tasks.push(task);
*/
this.start = function(task){
tasks.push(task);
@@
-77,12
+88,17
@@
Roo.util.TaskRunner = function(interval){
startThread();
return task;
};
startThread();
return task;
};
-
+ /**
+ * Stop new task.
+ * @param {Object} task
+ */
this.stop = function(task){
removeTask(task);
return task;
};
this.stop = function(task){
removeTask(task);
return task;
};
-
+ /**
+ * Stop all Tasks
+ */
this.stopAll = function(){
stopThread();
for(var i = 0, len = tasks.length; i < len; i++){
this.stopAll = function(){
stopThread();
for(var i = 0, len = tasks.length; i < len; i++){