process.channel.ref()


如果之前调用了 .unref(),此方法会使 IPC 通道保持进程的事件循环运行。

【This method makes the IPC channel keep the event loop of the process running if .unref() has been called before.】

通常,这是通过在 process 对象上设置 'disconnect''message' 监听器的数量来管理的。然而,这种方法可以用来明确请求某种特定的行为。

【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.】