I agree that not having a natural flow of control is more prone programming debugging. However, he does say things that are wrong, ex:
"It's impossible to slow down the pace of accepting new incoming client connections."
You can slow down the pace by doing the following:
const http = require('http');
let count = 0;
const THRESHOLD = 1;
const server = http.createServer((req, res) => {
if (count++ < THRESHOLD) {
// do work
res.write('success');
res.end();
setTimeout(() => count--, 10 * 1000);
} else {
res.write('limit');
res.end();
count--;
}
});
server.listen(10000);