worker.process
所有的工作线程都是使用 child_process.fork() 创建的,该函数返回的对象会被存储为 .process。在工作线程中,全局的 process 会被存储起来。
🌐 All workers are created using child_process.fork(), the returned object
from this function is stored as .process. In a worker, the global process
is stored.
参见:子进程模块。
🌐 See: Child Process module.
如果 process 上发生 'disconnect' 事件且 .exitedAfterDisconnect 不为 true,工作进程将调用 process.exit(0)。这可以防止意外断开连接。
🌐 Workers will call process.exit(0) if the 'disconnect' event occurs
on process and .exitedAfterDisconnect is not true. This protects against
accidental disconnection.