josdejong/workerpool

Make sure stats are always consistent when handling a task result

Open

#411 创建于 2023年12月3日

在 GitHub 查看
 (5 评论) (0 反应) (0 负责人)JavaScript (164 fork)github user discovery
enhancementhelp wanted

仓库指标

Star
 (2,297 star)
PR 合并指标
 (PR 指标待抓取)

描述

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?

贡献者指南