Christopher Kade
Inspired by James Snell's talk at CascadiaJS 2018
@christo_kade
Understanding precisely how this part of Node works
Debugging efficiently my Node projects
Two parts:
Event Loop
C++
Javascript
Event Loop notification
NTQ
MTQ
process.nextTick(callback)
.then()
.catch()
.finally()
setTimeout(callback)
setInterval(callback)
Accepting new connections & data related calls
Callbacks linked to closing of sockets etc.
The Event Loop executes only one task at a time
When Javascript is running, the Event Loop is not (both on a single thread)
The Event Loop is composed of more than one queue (or queue-like structure)
References:
Node.js event loop workflow & lifecycle in low level - http://voidcanvas.com/nodejs-event-loop/
Observing NodeJS - https://www.youtube.com/watch?v=V0LcfB-H0aY&t=
By christopherkade