class DynamicPool extends DynamicThreadPool<WorkerData> {
private static instance: DynamicPool;
- private constructor(min: number, max: number, filename: string, opts?: PoolOptions<Worker>) {
- super(min, max, filename, opts);
+ private constructor(min: number, max: number, workerScript: string, opts?: PoolOptions<Worker>) {
+ super(min, max, workerScript, opts);
}
- public static getInstance(min: number, max: number, filename: string): DynamicPool {
+ public static getInstance(min: number, max: number, workerScript: string): DynamicPool {
if (!DynamicPool.instance) {
- DynamicPool.instance = new DynamicPool(min, max, filename,
+ DynamicPool.instance = new DynamicPool(min, max, workerScript,
{
exitHandler: (code) => {
if (code !== 0) {
*
* @param {string} workerScript
*/
- constructor(workerScript: string, numThreads: number) {
+ constructor(workerScript: string, numberOfThreads: number) {
super(workerScript);
- this.pool = StaticPool.getInstance(numThreads, this.workerScript);
+ this.pool = StaticPool.getInstance(numberOfThreads, this.workerScript);
}
get size(): number {
class StaticPool extends FixedThreadPool<WorkerData> {
private static instance: StaticPool;
- private constructor(numThreads: number, workerScript: string, opts?: PoolOptions<Worker>) {
- super(numThreads, workerScript, opts);
+ private constructor(numberOfThreads: number, workerScript: string, opts?: PoolOptions<Worker>) {
+ super(numberOfThreads, workerScript, opts);
}
- public static getInstance(numThreads: number, workerScript: string): StaticPool {
+ public static getInstance(numberOfThreads: number, workerScript: string): StaticPool {
if (!StaticPool.instance) {
- StaticPool.instance = new StaticPool(numThreads, workerScript,
+ StaticPool.instance = new StaticPool(numberOfThreads, workerScript,
{
exitHandler: (code) => {
if (code !== 0) {