Skip to content

Instantly share code, notes, and snippets.

@mciparelli
Created July 17, 2013 18:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mciparelli/6022943 to your computer and use it in GitHub Desktop.
Save mciparelli/6022943 to your computer and use it in GitHub Desktop.
suspend-generators
var suspend = require('suspend');
suspend(function* (resume) {
while (true) {
try {
yield request('http://www.unexistanturl.com', resume);
} catch (err) {
debug(err);
}
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment