Its for the server startup sequence where it generates one hugh
javascript file for the client side to download and it keeps it raw as
well gzipped in memory. It does read the files with readSyncFile etc.
So yes I want the node process to be halted until it is done. Its fine
it takes 2 seconds, so please don't argue it could do this or that in
parallel. I also do the other *Sync calls for startup. I just want to
keep that simple please.
- Axel
- Axel
--
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
BTW: Please, stay with the topic. It is about "how to do it" and not
about "convince me to do not this way" Thank you.
--
Oliver Leics @ G+
https://plus.google.com/112912441146721682527
Yes thank you. That's a pragmatic solution that only came to my mind after I posted. I suppose later ill have to do a more developed startup anyway when I'm utilizing a database.
--
> I wonder why node doesn't just expose a sync version of the zlib functions. It's not like they are performing I/O or anything. FWIW I intend to have both sync and async in luvit's zlib bindings unless there is a good reason not to.
Did you say *sync*? Heresy!
--
Jorge.
Here's why: https://github.com/joyent/node/issues/3128#issuecomment-5197171
I'm not sure how the node modules system behaves if you alter required
tables, so would this work*?
var gotyou = function() { throw new Error('Evil Sync caller you!'); };
for (var k in fs) {
if (fs.hasOwnProperty(k) && k.search(/Sync$/) >= 0) { fs[k] = gotyou; }
}
*Unless something is that evil to cache the function pointers, or to
require later on. However, one could set "require" to gotyou as well
after startup.
npm install nosync
require("nosync")
fs.openSync("filename", "r") // <-- throws
Cool. Thats why I don't buy into the argument, the Sync versions of
the un/compress API would lead to people misusing it, since it can be
inhibited as easy as you showed us.
Although I do buy into the argument, it is hardly used/requested and
for the amount of code to maintain it's not worth it and easy to
workaround with Asyncs rather than bloating the node core.