mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-06-18 02:59:04 +00:00
Updated AsyncFunction (markdown)
parent
298c2afb55
commit
7552c01f14
|
@ -27,22 +27,22 @@ var STD = require("lib/std");
|
|||
|
||||
function onShoutcut(args) {
|
||||
[5, 4, 3, 2, 1].forEach(function(x) {
|
||||
new AsyncFunction('sub_01', '[module name]').run(x);
|
||||
sub_01.run();
|
||||
});
|
||||
}
|
||||
|
||||
function _async_sub_01(args) {
|
||||
var sub_01 = new AsyncFunction(function(args) {
|
||||
var x = args[0];
|
||||
|
||||
sleep(x * 1000);
|
||||
console.log(x);
|
||||
}
|
||||
});
|
||||
|
||||
function main(args) {
|
||||
if (!AsyncFunction.bind(exports, args)) {
|
||||
AsyncFunction.bind(exports, args); // if this is completed, stop with AsyncFunction.Resolved exception
|
||||
|
||||
onShoutcut(args);
|
||||
}
|
||||
}
|
||||
|
||||
exports.main = main;
|
||||
exports.onShoutcut = onShoutcut;
|
||||
|
|
Loading…
Reference in New Issue
Block a user