mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-05-17 15:11:04 +00:00
Update task.js
This commit is contained in:
parent
7656327a76
commit
4c0b5f8946
26
lib/task.js
26
lib/task.js
|
@ -88,8 +88,9 @@ var TaskQueue = function() {
|
||||||
this.run = function() {
|
this.run = function() {
|
||||||
this._keepalive = true;
|
this._keepalive = true;
|
||||||
while(this._keepalive) {
|
while(this._keepalive) {
|
||||||
|
var now = new Date().getTime();
|
||||||
this.next();
|
this.next();
|
||||||
sleep(100);
|
sleep(1);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
this.stop = function() {
|
this.stop = function() {
|
||||||
|
@ -133,4 +134,25 @@ exports.run = function(q) {
|
||||||
|
|
||||||
exports.stop = function(q) {
|
exports.stop = function(q) {
|
||||||
q.stop();
|
q.stop();
|
||||||
}
|
};
|
||||||
|
|
||||||
|
/*
|
||||||
|
exports.setTimeout = function() {
|
||||||
|
var f = null;
|
||||||
|
var delay = 0;
|
||||||
|
var params = [];
|
||||||
|
|
||||||
|
if (arguments.length > 2) {
|
||||||
|
f = arguments[0];
|
||||||
|
delay = arguments[1];
|
||||||
|
params = arguments.slice(2);
|
||||||
|
} else if (arguments.length == 2) {
|
||||||
|
f = arguments[0];
|
||||||
|
delay = arguments[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (f != null) {
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
*/
|
||||||
|
|
Loading…
Reference in New Issue
Block a user