This Node.js lesson will continue the last lesson where we learned how the LibUV library works internally. We will learn about Event Loop and understand various terms like call stack, callback queue, etc. Let’s start.
Hey everyone, this lesson will continue the last lesson where we learned how the LibUV library works internally. In this lesson, we will learn about Event Loop and understand various terms like call stack, callback queue, etc. Let’s start.
A call stack is a data structure that holds information about what line of the function is currently being executed. A call stack is used to keep method calls, and it follows the LIFO (Last In First Out) data structure. By LIFO, we mean a container where the last item entered will be the first to get out. There is only one entry from the top, and if you want to take the item at the end, you will have to take everything on top first. If you’re thinking about a box of Pringles, then you’re absolutely correct.
Let’s understand how this call stack holds method calls:
Callback excallidraw example
The execution will go on like this:
In this Node.js Lesson, we are going to talk about the internals of Nodejs. This article will guide how node js works and how it can handle async tasks. What will happen if ten requests come at once? Will it handle one request and discard the other 9? or will it create a queue and serve each one by one. We will answer all these questions in this and coming lesson. Let's start.
This Edureka Live video on 'How to build CRUD REST API using Node.js'' will help you understand the concept of RESTful APIs and how you can create one using Node.js and Express.js.