A Conversation Example
To help you understand how events work in Node.js compared to traditional threaded webservers, consider an example of having different conversations with a large group of people at a party. You are acting the part of the webserver, and the conversations represent the work necessary to process different types of web requests. Your conversations are broken up into several segments with different individuals. You end up talking to one and then another, then back to the first and then a third, back to the second, and so on.
The conversation example works well because it has many similarities to webserver processing. Some conversations end quickly (for example, a simple request for a piece of data in memory). Others are broken ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access