just a helper for this demo
async function tryShutdown () {
    if (jobsToComplete === 0) {
      await new Promise((resolve) => { setTimeout(resolve, 500) })
      await worker.end()
      process.exit()
    }
  }