Created
April 25, 2012 19:25
-
-
Save sandosh/2492534 to your computer and use it in GitHub Desktop.
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
function get_result(callback) { | |
fetch_something_from_network().complete(callback); | |
} | |
app.get('/longpolling', function(req, res){ | |
get_result(function(error, result){ | |
res.send(result, error && 400 || 200); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment