报错是
E:\Workspace\TZ\LTE-Test\client>node-dev client.js
Starting ping http://www.baidu.com...
exec error: ReferenceError: $await is not defined
代码:
var Wind = require("wind");
Wind.logger.level = Wind.Logging.Level.INFO;
var pingAsync = Wind.Async.Binding.fromStandard(require('./lib/ping'),'data');
var worker = eval(Wind.compile("async", function(job){
var data
while(true){
try {
job.pingCfg.job.forEach(function(item){
console.log('Starting ping %s...',item.url);
result = $await(pingAsync(item.url));
console.log('ping result: %j',result.data);
})
} catch(e){
console.log('exec error: ' + e);
}
$await(Wind.Async.sleep(job.jobInterval*60*1000));
}
}))
worker(jobObj).start()
5 回复