Open bmeck opened 2 years ago
const worker_threads = require('worker_threads'); const controller = new AbortController(); const {signal} = controller; new worker_threads.Worker(` setTimeout(() => console.log(require('worker_threads').workerData.aborted), 50); console.log('ready!') `, { eval: true, workerData: signal, transferList: [ signal ] }); setTimeout(() => controller.abort(), 10);