From: Jérôme Benoit Date: Mon, 11 Dec 2023 13:13:33 +0000 (+0100) Subject: refactor: cleanup worker code X-Git-Tag: v3.0.11~6 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=04212af7b1a1494ff58da58c9e5b3397d25f18b7;p=poolifier.git refactor: cleanup worker code Signed-off-by: Jérôme Benoit --- 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 */