Created
December 5, 2012 05:18
-
-
Save volca/4212565 to your computer and use it in GitHub Desktop.
promise for node.js
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
some_fun(req, res, next) | |
.pipe(function() { return redis.incr('next_id') }) | |
.fail(function(e) { return next(e); }) | |
.pipe(function() { return redis.set('key', {id:r, now:Date.now()}) }) | |
.done(function(res) {res.send([1, 'ok'];}) | |
.fail(function(e) {return next(e); }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment