Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

325
Views
Observed - Error: Timeout: Did not receive an init message from worker after 10000ms. Make sure the worker calls expose()

I have below code in the Index.js file

 try {
        pool = Pool(() => spawn(new Worker('./SubFlows')), workers);
        for (let i = 0; i < dataset.length; i += 1) {
            const task = pool.queue(async (subFlows) => {
                await subFlows(dataset[i], i);
            });
            myTasks.push(task);
        }
    } catch (err) {
        throw err;
    } finally {
        await Promise.allSettled(myTasks);
        await pool.completed(true);
        await pool.terminate(true);
    }

SubFlows.js:

async function subFlows(data, threadId) {
   
    try {
        //business logic goes here.
    }
    catch (e) {
       throw e;
    }
}
expose(subFlows);

The above code is inconsistent and some time its executing fine based on the "dataset.length" but most of time it throws bellow error message.

C:\Users\achu\Documents\New_folder\firetv\framework-v3.0\node_modules\observable-fns\dist\observable.js:42
        setTimeout(() => { throw error; }, 0);
                           ^

Error: Timeout: Did not receive an init message from worker after 10000ms. Make sure the worker calls expose().
    at Timeout._onTimeout (C:\Users\achu\Documents\New_folder\firetv\framework-v3.0\node_modules\threads\dist\master\spawn.js:35:53)
    at listOnTimeout (internal/timers.js:557:17)
    at processTimers (internal/timers.js:500:7)

Can someone help me to resolve this error message

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!