josdejong/workerpool

Make sure stats are always consistent when handling a task result

開放

#411 建立於 2023年12月3日

 (5 則留言) (0 個反應) (0 位負責人)JavaScript (164 個分叉)github user discovery
enhancementhelp wanted

倉庫指標

星標
 (2,307 顆星)
PR 合併指標
 (平均合併 21天 16小時) (30 天內合併 3 個 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?

貢獻者指南