Node.js event loop — simplified

The event loop phases as described in https://nodejs.org
const slowOperation = () => {
setTimeout(() => {
console.log('long operation completed')
}, 3000)
}
slowOperation()
  1. slowOperation() invoked and added to the stack
  2. setTimeout() invoked and added to the stack
  3. setTimeout() instantiate Node timer

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Modules

AJAX CALL (How to send a request to the server using XMLHttpRequest)

Learn this before picking up a frontend framework

HTML DOM tree of objects

SFrame.js: end to end encryption for WebRTC

About “flutter_hooks: Bad state: Type mismatch between hooks”.da

Advanced React Questions and Answers

Google Summer of Code 2018: Final report

How Webpack raised $15,000 in 3 months, and the future of open source

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Aviad H

Aviad H

More from Medium

End to end testing with NodeJS using CodeceptJS with real world example — Part 2(a): Locating…

How to use node version manager in Windows ?

Lets get user inputs using inquirer and Yargs — Creating a npm command line Utility — Part 2

Setting up a node project in typescript from Scratch