Created
May 9, 2011 13:49
-
-
Save darscan/962548 to your computer and use it in GitHub Desktop.
And so I abandoned the Ruby to Node port after writing this:
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
Function.prototype.or = function(callback) { | |
var next = this; | |
return function(err, doc) { | |
if (err) { | |
callback(err, doc); | |
} else { | |
next(doc, callback); | |
} | |
}; | |
}; |
Thanks Till! I'd come across task.js, but not Spidernode. Will bookmark for future reference.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You should take a look at Spidernode in combination with task.js: Seamless async functions chaining using generators. See slides 37 to 39 of this presentation for details.