Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在由创建的子线程中引发错误cluster.fork(),我想杀死父线程(并且这样做,杀死所有其他同级线程。
cluster.fork()
我怎样才能从子线程(:)中做到这cluster.isWorker === true一点true?
cluster.isWorker === true
true
我想我想通了。从工作人员内部,我似乎无法process全局访问,但这似乎有效:
process
cluster.worker.process.kill(cluster.worker.process.ppid)