Created
May 2, 2014 17:05
-
-
Save piscisaureus/86ccc2eb34f1f195218b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var contents = yield fs.readFile('bla'); | |
yield zone.create(() => { | |
http.get('google.com/bla').pipe(fs.createWriteStream('cache/file1')) | |
http.get('google.com/bl2').pipe(fs.createWriteStream('cache/file2')) | |
http.get('google.com/bl3').pipe(fs.createWriteStream('cache/file3')) | |
}); | |
console.log('all done!') | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Well, I think this came up earlier, but generators (yield) support is not implemented yet for zones.
The error you're seeing is caused by the fact that generator support for node needs to be turned on with a flag, try:
That still won't do anything useful but it turns on generator support.