Update task.js

This commit is contained in:
Namhyeon Go 2021-06-23 12:03:44 +09:00 committed by GitHub
parent a6ef912c85
commit ada2ea5170
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;