If node is single threaded and I can only be making one database call at any time, what is the point of having a pool of db connnections?
--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com
To unsubscribe from this group, send email to
nodejs+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
You received this message because you are subscribed to a topic in the Google Groups "nodejs" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/nodejs/-_pSIeB7Vws/unsubscribe.
To unsubscribe from this group and all its topics, send an email to nodejs+un...@googlegroups.com.
Ummm... You can write a driver in JS code that use require('net'). And in that module, the socket I/O is, at the end, managed by LibUv. The same for require('fs') for file I/O.Am I right?And yes, the driver could be implemented in C, and then, it should call LibUv in some way.
I just found:It manage a pool:A pool manage a list of available Connectionand connection use require('net')That's the magic! ;-) The driver author uses LibUv indirectly.
Matt,just so I understand, you are saying if a node package such as mongodb provides connection pooling, they have to be implementing the package using a pooling system that is implemented in C?
That's the magic! ;-) The driver author uses LibUv indirectly.
And that emphatically does NOT use threads in this case.
Yes, you are right, so I said "uses LibUv indirectly", without adding "with threads", now.--
Only for complete the topic, I also mentioned require('fs'). I'm not sure the scope of the use of threads in filesystem, but AFAIK (in Windows?) lib uv could use a pool of thread for some operations that are not easily mapped to async IO in host operating system