process.channel.unref()
此方法使 IPC 通道不会保持进程的事件循环运行,并且即使在通道打开时也让它完成。
通常,这是通过 process
对象上的 'disconnect'
和 'message'
监听器的数量来管理的。
但是,此方法可用于显式请求特定行为。
This method makes the IPC channel not keep the event loop of the process running, and lets it finish even while the channel is open.
Typically, this is managed through the number of 'disconnect'
and 'message'
listeners on the process
object. However, this method can be used to
explicitly request a specific behavior.