As far as I know node does not support something like that. One idea that came to mind is to add support for associating arbitrary context to a domain<http://nodejs.org/docs/latest/api/all.html#all_domain> and extract it along the way.
I was thinking on trying to hack something like that. Any thoughts? Elad. On Mon, Jul 2, 2012 at 5:25 PM, Ben Noordhuis <i...@bnoordhuis.nl> wrote: > On Mon, Jul 2, 2012 at 8:45 AM, Gaurav Vaish <gaurav.va...@gmail.com> > wrote: > > Hi, > > > > What is the best way to implement a thread-local / request-local > > storage? > > > > Basically, I am looking at a way to implement per-request-singleton > > object definition. > > > > (ThreadLocal: > http://docs.oracle.com/javase/6/docs/api/java/lang/ThreadLocal.html) > > I'm not sure what you mean. Are you talking about TLS in C/C++ or > something in JS? > -- Elad.