Skip to content

Instantly share code, notes, and snippets.

@hayes
Created March 28, 2014 18:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save hayes/9839519 to your computer and use it in GitHub Desktop.
Save hayes/9839519 to your computer and use it in GitHub Desktop.
var cls = require('continuation-local-storage')
, concat = require('concat-stream')
, http = require('http')
var foo = cls.createNamespace('foo')
http.createServer(foo.bind(function(req, res) {
req.pipe(concat(done))
function done() {
res.write(JSON.stringify(foo.active)) //null
res.end()
}
})).listen(6789)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment