Hi John! Thank you for your article, it helps me a lot currently. But in TypeScript it seems that the pool variable has no minWorkers/maxWorkers comment. I could not find it in documentation also. Did you use an older version of this library?
minWorkers: number | 'max'. The minimum number of workers that must be initialized and kept available. Setting this to 'max' will create maxWorkers default workers (see below).
maxWorkers: number. The default number of maxWorkers is the number of CPU's minus one. When the number of CPU's could not be determined (for example in older browsers), maxWorkers is set to 3.
Yes, I know it is written in docs.I was talking not about the options, but about the data after the pool starts. So, anyway, I found the answer. If someone will have issues like me: The pool data was moved into seperate .stats() method, so you can view all worker number there).
Anyway, thanks John)
Hi John! Thank you for your article, it helps me a lot currently. But in TypeScript it seems that the pool variable has no minWorkers/maxWorkers comment. I could not find it in documentation also. Did you use an older version of this library?
Hi Bunyamin. I'm glad the article helped 👍. The current version is 6.1.4 and the one I created a video for was 6.1.0, so it's pretty recent.
Also, in their GitHub docs, you will see references to minWorkers and maxWorkers. Strange how it's not available in the TS Interfaces.
github.com/josdejong/workerpool
From Their README:
The following options are available:
minWorkers: number | 'max'. The minimum number of workers that must be initialized and kept available. Setting this to 'max' will create maxWorkers default workers (see below).
maxWorkers: number. The default number of maxWorkers is the number of CPU's minus one. When the number of CPU's could not be determined (for example in older browsers), maxWorkers is set to 3.
Yes, I know it is written in docs.I was talking not about the options, but about the data after the pool starts. So, anyway, I found the answer. If someone will have issues like me: The pool data was moved into seperate .stats() method, so you can view all worker number there).
Anyway, thanks John)
Oh I see. Bleh sorry for misunderstanding your question. I'm glad you came right and this is a great find 👏.