We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
当执行栈(call stack)为空的时候,开始依次执行:
再简单点可以总结为:
不要混淆nodejs和浏览器中的event loop
理解事件循环一(浅析)
理解事件循环二(macrotask和microtask)
Event Loop 必知必会(六道题)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
microtask
macrotask
nodejs 的 eventloop 分6个阶段
浏览器中事件循环如何执行一个任务的流程
当执行栈(call stack)为空的时候,开始依次执行:
a: 在 microtask 中选出最早的任务 task X
b: 如果 task X 为null (那 microtask 队列就是空),直接跳到 g
c: 将 currently running task 设置为 task X
d: 执行 task X
e: 将 currently running task 设置为 null 并移出 task X
f: 在 microtask 中选出最早的任务 , 跳到 b
g: 结束 microtask 队列
上面就算是一个简单的 event-loop 执行模型
再简单点可以总结为:
参考资料
不要混淆nodejs和浏览器中的event loop
理解事件循环一(浅析)
理解事件循环二(macrotask和microtask)
Event Loop 必知必会(六道题)
The text was updated successfully, but these errors were encountered: