开发者

In Node.js how does the event loop work? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.

Want to improve this question? Update the question so it focuses on one problem only by editing this post.

Closed 3 years ago.

开发者_如何学运维 Improve this question

I would like to understand the event-loop module - exactly what's going on behind the scene (OS wise, Thread wise) in node.js What happen when someone write to a file and apply a callback. how does the setTimeout work?


The event loop mechanism is almost same on frontend and backend if you're using Node or JS. The setTimeout is not part of JS or Node, this method is part of browser API (frontend) and V8 engine(backend). You can understand it visually with this video by Phillip: https://www.youtube.com/watch?v=8aGhZQkoFbQ

Once, the broader concept is clear, you can read more about Microtasks, https://javascript.info/microtask-queue

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜