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,21 +27,21 @@ var STD = require("lib/std");
|
||||||
|
|
||||||
function onShoutcut(args) {
|
function onShoutcut(args) {
|
||||||
[5, 4, 3, 2, 1].forEach(function(x) {
|
[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];
|
var x = args[0];
|
||||||
|
|
||||||
sleep(x * 1000);
|
sleep(x * 1000);
|
||||||
console.log(x);
|
console.log(x);
|
||||||
}
|
});
|
||||||
|
|
||||||
function main(args) {
|
function main(args) {
|
||||||
if (!AsyncFunction.bind(exports, args)) {
|
AsyncFunction.bind(exports, args); // if this is completed, stop with AsyncFunction.Resolved exception
|
||||||
|
|
||||||
onShoutcut(args);
|
onShoutcut(args);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.main = main;
|
exports.main = main;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user