Getting to know NodeJs event loop, how synchronous and asynchronous calls are processed



callback stack first serves all synchronous callbacks, and remove from  the stack when one is done executing, node api such as setTimeout, setImmediate, setInterval?, they for asynchronous calls put respected functions into callback queue, only when callback stack is empty would callback queue items be put to callback stack for execution.

Execution structure:

Event loop phases:

https://www.freecodecamp.org/news/nodejs-eventloop-tutorial/

https://nodejs.org/en/docs/guides/event-loop-timers-and-nexttick/

[NG]https://angular.io/guide/creating-injectable-service

https://angular.io/guide/security

留下你的评论