josdejong/workerpool

Make sure stats are always consistent when handling a task result

Ouverte

#411 ouverte le 3 déc. 2023

 (5 commentaires) (0 réaction) (0 personne assignée)JavaScript (164 forks)github user discovery
enhancementhelp wanted

Métriques du dépôt

Stars
 (2 307 étoiles)
Métriques de merge PR
 (Merge moyen 21j 16h) (3 PRs mergées en 30 j)

Description

Hi, thank you for this great library.

I'm using it with the following syntax:

const pool = workerpool.pool(__dirname + '/import-worker-fast-v3.js', {
  minWorkers: 'max',
  maxWorkers: 8,
  workerType: 'thread',
});

During execution of a loop, I check pool.stats() and I get the following output:

active: 7 
pendingTasks: 9786 
busyWorkers: 7 
idleWorkers: 1 
totalWorkers: 8

One worker is always idle. Am I doing something wrong?

Guide contributeur