X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fpools%2Fcluster%2Ffixed.ts;h=4ec81c07bab66b0ebad1cb3eed371ea568989ef0;hb=063f8c5b3fc95d2e20fa35dcd63f635ee62bf5c1;hp=6246320e3072d18371646d431692abda06b85ea1;hpb=a35560bac09e829e1e19f88f8fd1d71a64c9d50b;p=poolifier.git diff --git a/src/pools/cluster/fixed.ts b/src/pools/cluster/fixed.ts index 6246320e..4ec81c07 100644 --- a/src/pools/cluster/fixed.ts +++ b/src/pools/cluster/fixed.ts @@ -76,13 +76,6 @@ export class FixedClusterPool< worker.on('message', listener) } - protected unregisterWorkerMessageListener ( - worker: Worker, - listener: (message: MessageValue) => void - ): void { - worker.removeListener('message', listener) - } - protected createWorker (): Worker { return fork(this.opts.env) } @@ -91,5 +84,6 @@ export class FixedClusterPool< // We will attach a listener for every task, // when task is completed the listener will be removed but to avoid warnings we are increasing the max listeners size worker.setMaxListeners(this.opts.maxTasks ?? 1000) + this.registerWorkerMessageListener(worker, super.workerListener()) } }