In the previous article, we reviewed our understanding of the Nodejs event loop. We understood how Nodejs uses multiple callback queues for different functions and pushes them back on the call stack in a particular priority. In the bonus section, I introduced the microtask queue which is responsible for handling functions deferred using the Promise API. Microtask queue has the highest priority over any other queue, also, it is divided into further two queues: One for the functions deferred using process.nextTick() and other for Promises.
In this article, we will understand what a promise is, what is it doing in the background, and understand its behavior. …
In this article we will review the asynchronous nature of Nodejs relying on event loop. Simple yet powerful asynchronicity is one of the key features of Node.js which allows us to build highly scalable applications.
What is Node.js? It is a Javascript runtime environment. Originally Javascript was meant to be run in browser environment, and the was the case before Node.js came along. When Javascript started gaining popularity, development teams behind major browsers worked hard to offer better support for Javascript and find ways to run it faster. This led to the development of V8 engine from The Chromium project. V8 engine was built to power modern and demanding Javascript execution in Chrome/Chromium browser. Node.js …
About