worker[Symbol.asyncDispose]()
退出 dispose 作用域时调用 worker.terminate()
。
¥Calls worker.terminate()
when the dispose scope is exited.
async function example() {
await using worker = new Worker('for (;;) {}', { eval: true });
// Worker is automatically terminate when the scope is exited.
}