[英]How can I kill the parent process from a child thread spawned by cluster.fork?
在cluster.fork()
創建的子線程中拋出錯誤,我想殺死父線程(這樣做,殺死所有其他同級線程。
如何從子線程中執行此操作( cluster.isWorker === true
: true
)?
我想我想通了。 從工作人員內部,我似乎無法全局訪問process
,但這似乎有效:
cluster.worker.process.kill(cluster.worker.process.ppid)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.