mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-02-06 15:04:58 +00:00
Update task.js
This commit is contained in:
parent
a6ef912c85
commit
ada2ea5170
10
lib/task.js
10
lib/task.js
|
@ -2,6 +2,16 @@
|
|||
// Task API (Time-sharing based `async` implementation in WSH.js)
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/* // example:
|
||||
* // var TASK = require("lib/task");
|
||||
* // var queue = TASK.createTaskQueue();
|
||||
* // TASK.putTask(queue, function() { console.log('123'); }, [1, 2, 3])
|
||||
* // .then(createTask(function() { console.log('456'); }, [4, 5, 6])
|
||||
* // .then(createTask(function() { console.log('789'); }, [7, 8, 9])
|
||||
* // ;
|
||||
* // queue.run()
|
||||
*/
|
||||
|
||||
var Task = function(f, params)
|
||||
this.f = f;
|
||||
this.params = params;
|
||||
|
|
Loading…
Reference in New Issue
Block a user