Skip to content

Instantly share code, notes, and snippets.

View mciparelli's full-sized avatar

Martín Ciparelli mciparelli

  • Buenos Aires, Argentina
View GitHub Profile
@mciparelli
mciparelli / gist:6022840
Created July 17, 2013 17:53
generators
run(function* (gen) {
while (true) {
try {
yield request('http://www.unexistanturl.com', gen());
} catch (err) {
debug(err);
}
}
})
@mciparelli
mciparelli / suspend-generators.js
Created July 17, 2013 18:07
suspend-generators
var suspend = require('suspend');
suspend(function* (resume) {
while (true) {
try {
yield request('http://www.unexistanturl.com', resume);
} catch (err) {
debug(err);
}
}