Created
July 17, 2013 17:53
-
-
Save mciparelli/6022840 to your computer and use it in GitHub Desktop.
generators
This file contains 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
run(function* (gen) { | |
while (true) { | |
try { | |
yield request('http://www.unexistanturl.com', gen()); | |
} catch (err) { | |
debug(err); | |
} | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I dunno why it enters catch block just once :S @creationix