Skip to content

Instantly share code, notes, and snippets.

@idx3d
Created September 6, 2013 13:33
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 idx3d/6463854 to your computer and use it in GitHub Desktop.
Save idx3d/6463854 to your computer and use it in GitHub Desktop.
My tries
var fs = require('fs');
var co = require('co');
var express = require('express');
var wrapper = require('co-express');
var app = wrapper(express());
var wait = require('co-wait');
app.get('/test', function* (req, res, next) {
yield waitAndAnswer(res)
});
function* waitAndAnswer (res) {
yield wait(10000);
res.send('Done: ' + Date.now());
}
app.listen(8000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment