Skip to content

Instantly share code, notes, and snippets.

@kriszyp
Created January 7, 2010 16:51
Show Gist options
  • Save kriszyp/271364 to your computer and use it in GitHub Desktop.
Save kriszyp/271364 to your computer and use it in GitHub Desktop.
var posix = require("posix");
var print = require("sys").puts;
var j = 0;
for(var i = 0;i < 100; i++){
posix.stat("file" + i, process.O_RDONLY, 0666) // these files don't exist
.addErrback(function(e){
j++; // only makes it to about 17
print(j);
})
.addCallback(function(){
print("won't be called");
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment