🔶 Introduction
Imagine a web application that sends hundreds of requests per second to a server that only processes one request per time...
For further actions, you may consider blocking this person and/or reporting abuse
Unfortunately that's a wrong diagram for the event loop. Node.js event loop is not like the JavaScript loop at all. 99% of diagrams like these are just simply wrong.
I taught this as part of my premium Node CLI Development course, but just shared that 10min video on Node.js theory, publicly for free on my YouTube Channel here.
I hope it's helpful.
Thanks a lot for your feedback and, as a developer, I'm always looking forward to learning and improving my knowledge. I'll really appreciate suggestions about correct examples of Node.js diagrams in order to update my article, so feel free to share them!
I taught this as part of my premium Node CLI Development course, but just shared that 10min video on Node.js theory, publicly for free on my YouTube Channel here.
I hope it's helpful.
Would you have an example of a good diagram? Share with us, please!
You read about event loop here.
Thanks a lot for sharing, for sure I'll read about it!
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
Just edited my comment with the explanation/video — I hope it helps.
I found this talk from Bryan Hughes, Microsoft the best there is to understand the Node.js event loop
Thanks a lot for sharing this valuable content!
Hey Cássio, thanks for sharing this. I couldn't find anything online about Ryan Dahl originally being a PHP developer. What was your source for this? I'm intrigued!
You're welcome, thanks for reading it! Actually, in the process of writing this article I watched many Ryahn Dahl interviews and now I couldn't find the one that confirmed that he was a PHP developer. Sorry about that! What I can confirm is that he was a web developer in the early 2000s, years before Node.js development.
So, because I couldn't find the right source, I'll update my article here!
Nice after long years read a simple but informative article about nodejs
Thanks a lot for your feedback, I'm glad to read that!
Growed, sended, shutted??? Please, next time you post, use some English grammar tool...
The message was passed and understood at least.
Thanks for your suggestion!
And now there is Deno.. maybe it is still not so popular, however all issues of Node.js solved more or less with this new tech, created by the same guy who once created Node.js
Thanks a lot for your contribution, I heard about Deno and for sure I'll pay attention to this new technology!
Welcome! It has a lot of pros.. Typescript based and no more node_modules.. checked a lot of boilerplates and projects, for me it is a step forward even if there are those who will argue with me..
Thanks for your alert, but I believe that this Spam has already been deleted!
thanks man. now I know more about Node.js
You're welcome, I'm glad that this article helped you!
Wonderful article, thanks for sharing
You're welcome, thanks a lot for your feedback!
Really helpful. Thank you!
Thanks a lot for your feedback, I'm glad that this article was helpful to you!
Thanks for sharing awesome info Cassio Cappellari. Keep doing and will love to read this kind of articles.
Thanks a lot for your feedback and for your words, I'm really glad to read that!
Thanks for the useful article
Thanks a lot, I'm glad to read that!
I just want to point out that Node is not single-threaded at all. Node being single-threaded is simply a misconception.
Thanks a lot for your contribution! In my studies about this technology I realize that Node.js it's a combination between single thread and multi thread platforms, and that is what makes it a great option for scalable web applications.
Great article! You have listed and explained so many great things about Node. However, I would also like to know the negative things about it.
Thanks a lot for your feedback, I'm glad to hear that! For sure every technology has pros and cons but, in my experience developing REST APIs, for me Node.js is a great tool and, at the moment, I couldn't tell you negative things about it!
Great post, we love NodeJS!
Thanks a lot for your feedback!
To whom this may interest, here (youtu.be/ztspvPYybIY) you can find Ryan Dahl: Original Node.js presentation explaining about Node concept and why it needs to be the way it is
Thanks for share such a valuable content!
Great article.
Thanks a lot!
Nice one
Thanks!
Awesome article! Keep it on! 👊
Thanks for your feedback and support! 👊
Pretty good article!
Thanks a lot for your feedback!
Thank you!
You're welcome, thanks for reading it!
Nice Cássio!
Thanks, Gilmara! 💙
Muito bom!!
Thank you! 💙
Grazie, Cássio, for explaining these features.
You're welcome, I hope that this article has helped you!
Node js can be blocked, if we calculate complex calculations on main thread. Can you post another article about "how to avoid this and more about child threads".
Thanks a lot for your contribution and suggestions!