I got this piece of code :
import http from 'http';
function compute() {
let [sum, i] = [1, 1];
while (i<1000000000) {
5*2
i++;
}
console.log("good");
process.nextTick(compute);
}
http.createServer((request, response) => {
response.writeHead(200, {'Content-Type': 'text/plain'});
response.end('Hello World');
}).listen(5000, '127.0.0.1');
http.request({hostname: '127.0.0.1', port: 5000}, (response) => {
console.log("here !");
}).end();
compute();
the output for that is always : "good, "good" ... and the HTTP request didn't get called. I thought that process.nextTick should solve that problem, but server is still blocked. Why ? How can I fix it ?