gpt4 book ai didi

node.js - 如何获取 Node 工作队列中的回调列表? (或者,为什么 Node 不会退出?)

转载 作者:IT老高 更新时间:2023-10-28 21:49:03 24 4
gpt4 key购买 nike

Node.js about page 上写着:

Node exits the event loop when there are no more callbacks to perform.

有没有办法找出哪些回调阻止了 Node 退出?

最佳答案

您可以使用 process._getActiveHandles()process._getActiveRequests()

this discussion在 node.js 邮件列表中。

更新:有一个很好的包 - https://github.com/mafintosh/why-is-node-running

关于node.js - 如何获取 Node 工作队列中的回调列表? (或者,为什么 Node 不会退出?),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17960452/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com