Update task.js

This commit is contained in:
Namhyeon Go 2021-06-23 12:08:38 +09:00 committed by GitHub
parent d33854a89f
commit 8e713a0d30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,9 +5,13 @@
/* // example:
* // var TASK = require("lib/task");
* // var taskQueue = TASK.createTaskQueue();
* // TASK.putTask(queue, function() { console.log('123'); }, [1, 2, 3])
* // .then(TASK.createTask(function() { console.log('456'); }, [4, 5, 6]))
* // .then(TASK.createTask(function() { TASK.stop(); console.log('789'); }, [7, 8, 9]))
* // TASK.putTask(queue, function() { console.log('123'); sleep(100); }, [1, 2, 3])
* // .then(TASK.createTask(function() { console.log('456'); sleep(200); }, [4, 5, 6]))
* // .then(TASK.createTask(function() { TASK.stop(); console.log('789'); sleep(300); }, [7, 8, 9]))
* // ;
* // TASK.putTask(queue, function() { console.log('321'); sleep(100); }, [3, 2, 1)
* // .then(TASK.createTask(function() { console.log('654'); sleep(200); }, [6, 5, 4]))
* // .then(TASK.createTask(function() { TASK.stop(); console.log('987'); sleep(300); }, [9, 8, 7]))
* // ;
* // taskQueue.run();
*/