Oh, that I can tell :p

I have given this just an example. It is not very useful to make requests 
accessible unless you want to run over each request object for some reason. 
It will also prevent garbage collection of call stacks and ram usage will 
increase rapidly on a real system. It was just a silly example to show how 
the opposite of what you want could be done.

If your question was about JavaScript (I still did not understand which one 
you meant by "Well, yes!" to a question between two alternatives), whatever 
you declare locally is private to that call stack, so the request. For 
JavaScript side of Node, there are no threads. For requests, it is exactly 
how I told in my previous answer.

For internal workings of it, each process have a few threads for 
inter-process communication and io, to my humble knowledge. 

Again, if you are developing a library for Node in C++, you still should 
not use threads other than the way Node uses them and I really did not 
understand your question in this case, that is why I thought I totally 
misunderstood and apologized for being naive.

Also, if it is about JavaScript, this is wrong group. :D nodejs group is 
where it should go.

Pehh, you put me in big dilemma sir. What were you asking, really?

On Wednesday, July 4, 2012 12:04:54 AM UTC-4, Gaurav Vaish wrote:
>
> > var requests = []; 
> > 
> > http.Server(function(req, res) { 
> >     // req and res are what you want, already provided. They are 
> > request-local. 
> >     requests.push(req); // here we provide a way for others to access 
> this 
> > private from outside. 
> > 
> > }); 
>
> Well, there's a catch => How do the "outside" know what "index in 
> array" are we looking at? 
>
>
>
>
> -- 
> Happy Hacking, 
> Gaurav Vaish 
> www.m10v.com 
>
>

Reply via email to