domain 域


稳定性: 0 - 弃用

源代码: lib/domain.js

此模块正在等待弃用。 一旦替代 API 完成,则该模块将被完全弃用。 大多数开发者应该没有理由使用此模块。 绝对必须拥有域提供的功能的用户可能暂时依赖它,但预计将来必须迁移到不同的解决方案。

域提供了一种将多个不同的 IO 操作作为一组来处理的方法。 如果任何注册到域的事件触发器或回调触发 'error' 事件,或抛出错误,则将通知域对象,而不是丢失 process.on('uncaughtException') 句柄中的错误上下文,或导致程序立即使用错误码退出。

Stability: 0 - Deprecated

Source Code: lib/domain.js

This module is pending deprecation. Once a replacement API has been finalized, this module will be fully deprecated. Most developers should not have cause to use this module. Users who absolutely must have the functionality that domains provide may rely on it for the time being but should expect to have to migrate to a different solution in the future.

Domains provide a way to handle multiple different IO operations as a single group. If any of the event emitters or callbacks registered to a domain emit an 'error' event, or throw an error, then the domain object will be notified, rather than losing the context of the error in the process.on('uncaughtException') handler, or causing the program to exit immediately with an error code.