Created
February 21, 2014 08:05
-
-
Save juliangruber/9130466 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
var wait = require('co-wait'); | |
var http = require('http'); | |
var co = require('co'); | |
co(function*(){ | |
http.createServer(function(req, res){ | |
res.end('hi') | |
}).listen(8004); | |
yield wait(1000); | |
throw new Error('foo'); | |
})(function(err){ | |
console.log('oops') | |
console.log(arguments) | |
http.createServer(function(req, res){ | |
res.end('ho') | |
}).listen(8005); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment