atbar
Version:
Async callback manager for javascript in nodejs and browser
23 lines • 545 B
JavaScript
/*
coffee -cb /opt/node/bb/dev/node_modules/atbar/atbar.cof
coffee -cb /opt/node/bb/dev/node_modules/atbar/tests/args.cof
*/var adl, slowDouble;
adl = require('atbar');
slowDouble = function(a, cb) {
var dbl;
console.log((dbl = 2 * a));
return setTimeout((function() {
return cb(dbl);
}), 1000);
};
adl.run('trace', function() {
this._(function() {
return slowDouble(1, this.$());
});
this._(function(b) {
return slowDouble(b, this.$());
});
return this._(function(c) {
return slowDouble(c, this.$());
});
});