Skip to content

Instantly share code, notes, and snippets.

@sandosh
Created April 25, 2012 19:25
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 sandosh/2492534 to your computer and use it in GitHub Desktop.
Save sandosh/2492534 to your computer and use it in GitHub Desktop.
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