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