From 04212af7b1a1494ff58da58c9e5b3397d25f18b7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Mon, 11 Dec 2023 14:13:33 +0100 Subject: [PATCH] refactor: cleanup worker code MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/worker/abstract-worker.ts | 2 -- src/worker/cluster-worker.ts | 8 +------- src/worker/thread-worker.ts | 8 +------- 3 files changed, 2 insertions(+), 16 deletions(-) diff --git a/src/worker/abstract-worker.ts b/src/worker/abstract-worker.ts index 5fcc3419..15259106 100644 --- a/src/worker/abstract-worker.ts +++ b/src/worker/abstract-worker.ts @@ -86,13 +86,11 @@ export abstract class AbstractWorker< * @param opts - Options for the worker. */ public constructor ( - type: string, protected readonly isMain: boolean, private readonly mainWorker: MainWorker, taskFunctions: TaskFunction | TaskFunctions, protected opts: WorkerOptions = DEFAULT_WORKER_OPTIONS ) { - // super(type) if (this.isMain == null) { throw new Error('isMain parameter is mandatory') } diff --git a/src/worker/cluster-worker.ts b/src/worker/cluster-worker.ts index 0fd90956..cafef7fc 100644 --- a/src/worker/cluster-worker.ts +++ b/src/worker/cluster-worker.ts @@ -32,13 +32,7 @@ export class ClusterWorker< taskFunctions: TaskFunction | TaskFunctions, opts: WorkerOptions = {} ) { - super( - 'poolifier:cluster-worker', - cluster.isPrimary, - cluster.worker as Worker, - taskFunctions, - opts - ) + super(cluster.isPrimary, cluster.worker as Worker, taskFunctions, opts) } /** @inheritDoc */ diff --git a/src/worker/thread-worker.ts b/src/worker/thread-worker.ts index d5ce3a2f..fdbab44e 100644 --- a/src/worker/thread-worker.ts +++ b/src/worker/thread-worker.ts @@ -41,13 +41,7 @@ export class ThreadWorker< taskFunctions: TaskFunction | TaskFunctions, opts: WorkerOptions = {} ) { - super( - 'poolifier:thread-worker', - isMainThread, - parentPort as MessagePort, - taskFunctions, - opts - ) + super(isMainThread, parentPort as MessagePort, taskFunctions) } /** @inheritDoc */ -- 2.34.1