INNER CODE UNIT · JavaScript

run

andywer/threads.js · test-tooling/rollup/app.js:3

async function run() {
  const add = await spawn(new Worker("./worker.js"))
  const result = await add(2, 3)
  await Thread.terminate(add)
  return result
}

run().then(result => {
  console.log(`Result: ${result}`)
  puppet.exit(0)
}).catch(error => {
  console.error(error)
  puppet.exit(1)
})

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…