You went on the Node.js website and read this: “Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.”
Now, if you have experience building event-driven servers, this will already make enough sense to you. (And this chapter is probably not for you!) However, if you’re like me, when you read this you probably decided to quit programming, because here’s a platform for developers and I’m a developer, but I’m too stupid to understand why I should care!
Okay, maybe that was a little bit of an exaggeration. You didn’t quit programming, and you’re not stupid for not understanding why you should care about Node.js.
My goal is that, by the end of this chapter, you will be proud to tell the world you understand how the Node.js event loop works and start receiving your much-deserved LinkedIn endorsements for “Node.js event loop.”
At a high level, event-driven programming is when a system expresses its interest in a particular set of events, provides a way to be alerted when said events happen, and responds to them using callbacks.
What do these terms mean, though? An event is some change in a system’s state. ...