Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You don't mean thread. JavaScript is single-threaded, so node is single-threaded. I don't mean to be picky, but people will understand you better if you use the nomenclature they've learned. The words 'thread' and 'process' are already too heavility overloaded at the OS level, best to avoid them unless that's really what we mean.</p> <p>It is quite common in node to pass the entire request object around.</p> <p>You have not provided a strong use case for building this identity map. Can you elaborate? </p> <p>If you really need to keep track of individual callbacks, you could use a guid-generator. Of course, you have to store those guids someplace and depending on how you do that you could end up creating a bottleneck for scaling.</p> <p>Ah.. I see your edit now... Where you write "where the App.User query can store it's results (and any other models can store their results, so if they are requested again it doesn't hit the database)." you're already thinking at a very high level. This is less of a node.js question and more of a framework question. What I mean is, node.js is a low-level kit which markets itself as a high-level framework. It's basically a mashup of javascript with an event loop supported by a thread pool. That would be OS threads, by the way. I think the answer to your question may be that you need to explicitly provide caching in your objects if you're looking to avoid extra hits to the database. As far as I know, there's no high-level magic for that baked into node. I know that doesn't really help, except maybe to say don't feel bad about not finding something that isn't there.</p> <p>Re: globals. Just don't do it. Friends don't let their friends write to global. :)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload