worker.terminate()
版本历史
| 版本 | 变更 |
|---|---|
| v12.5.0 | 此函数现在返回 Promise。传入回调已被弃用,在此版本之前无用,因为工作线程实际上是同步终止的。终止现在是完全异步的操作。 |
| v10.5.0 | 新增于: v10.5.0 |
尽快停止工作线程中的所有 JavaScript 执行。返回在触发 'exit' 事件 时完成的退出代码的 Promise。
\Stop all JavaScript execution in the worker thread as soon as possible.
Returns a Promise for the exit code that is fulfilled when the
'exit' event is emitted.