For the chapters that follow it's important to fully understand what it means, conceptually, that a Node.js application has synchronous and asynchronous operations, and how both operations interact with each other.
Let's try to build this understanding step by step.
The first concept that we need to understand is that of the Node.js event loop. The event loop is the execution model of a running Node.js application.
We can visualize this model as a row of loops:
I've drawn boxes because circles look really clumsy in ASCII art. So, these here look like rectangles, but please imagine them as circles - circles with an arrow, which means that one circle represents one iteration through the event loop.
Another visualization could be the following pseudo-code:
while (I still have stuff to do) { do stuff; }
Conceptually, at the very core of it, it's really...