Demystifying event loop and blocking code in nodejs
Hello guys, sorry to disturb you all; I'm currently learning nodejs and I came across the terms "event loop" and "blocking code".
Can someone just confirm whether my understanding is correct or if there are things that can be added:
From what I have understand, the event loop monitors whatever process happen in our node environment such as reading from a file or writing to a file. The event loop offload works on a specific process if that process is caught "waiting" so that other tasks can be perform by the time the other task finish waiting.
Now, from what I have understand for the term "blocking" code, it is possible to make an asynchronous piece of code waits until it finishes whatever it has to do then to proceed with the other instructions.
Also, everything inside a callback is blocking code?
0 Replies