Message from JavaScript discussions

April 2017

— (not that you would want to)


I made this test

Promise.resolve().then(() => fs.readFileSync('./Vines.mp4')).then(() => console.log('finished')); 
process.nextTick(() => {
console.log('next tick');
process.nextTick(() => console.log('next tick after that'))

And throws
next tick
next tick after that

— It's still blocking dude

— Sync calls freeze the process

— If its blocking the result doesnt have to be


next tick


next tick after that


— What?

— No

— I dont think its blocking the way you think, but it is blocking

— The operation simply does not run until the call stack ends

— But it does block at that point

— ^

— It is the same as just putting the readfile method at the end