DEV Community

Discussion on: Basic Concepts of Node.js

Collapse
 
olaviolacerda profile image
Olavio Lacerda

Would you have an example of a good diagram? Share with us, please!

Collapse
 
bam92 profile image
Abel Lifaefi Mbula

You read about event loop here.

Thread Thread
 
cassiocappellari profile image
Cássio Santiago Cappellari

Thanks a lot for sharing, for sure I'll read about it!

Thread Thread
 
yiorgosc profile image
yiorgosc

I think both explanations are part of the bigger picture of what actually the event loop does. async tasks are assigned to the thread pool and when finished their call back functions are put in the event queue. when nodejs's execution stack is empty, the event pool takes the first cb from the event queue and puts it back in the stack for execution

Collapse
 
ahmadawais profile image
Ahmad Awais ⚡️

Just edited my comment with the explanation/video — I hope it helps.