Answer the question
In order to leave comments, you need to log in
Do threads save memory?
Hello!
I watched a screencast on nodejs. There, the author clearly states the following position:
It is better to use streams as they save memory.
// ...
var body = '';
req
.on('readable', function() {
body += req.read();
if (body.length > 1e4) {
res.statusCode = 413;
res.end("Your message is too big for my little chat");
}
})
// ...
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question