event loop and callback queue ,call stack

https://medium.com/@Rahulx1/understanding-event-loop-call-stack-event-job-queue-in-javascript-63dcd2c71ecd

 

call stack

Javascript is single threaded asynchronous language .

Using asynchronous JavaScript (such as callbacks, promises, and async/await), you can perform long network requests without blocking the main thread. 

 

Event loop 

Event loop is an endless loop, which waits for tasks, executes them and then sleeps until it receives more tasks.

It  allows node js to perform non-blocking I/O operations.

 

Explain asynchronous and non-blocking APIs in Node.js.

  • All Node.js library APIs are asynchronous, which means they are also non-blocking
  • A Node.js-based server never waits for an API to return data. Instead, it moves to the next API after calling it, and a notification mechanism from a Node.js event responds to the server for the previous API call

 

 

 


Comments

Popular posts from this blog