josdejong/workerpool

Make sure stats are always consistent when handling a task result

オープン

#411 opened on 2023/12/03

 (5 件のコメント) (0 件のリアクション) (0 人の担当者)JavaScript (164 件のフォーク)github user discovery
enhancementhelp wanted

Repository metrics

Stars
 (2,307 個のスター)
PR merge metrics
 (平均マージ 21d 16h) (30d で 3 merged PRs)

説明

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?

コントリビューターガイド