From 88af9bf11e70a785747f7511e26d13355ba9deb7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sat, 16 Dec 2023 14:24:33 +0100 Subject: [PATCH] refactor: cleanup handler naming MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/pools/worker-node.ts | 8 ++++---- src/pools/worker.ts | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/pools/worker-node.ts b/src/pools/worker-node.ts index 63aff757..d80c03d8 100644 --- a/src/pools/worker-node.ts +++ b/src/pools/worker-node.ts @@ -146,25 +146,25 @@ export class WorkerNode /** @inheritdoc */ public registerWorkerEventHandler ( event: string, - listener: + handler: | OnlineHandler | MessageHandler | ErrorHandler | ExitHandler ): void { - this.worker.on(event, listener) + this.worker.on(event, handler) } /** @inheritdoc */ public registerOnceWorkerEventHandler ( event: string, - listener: + handler: | OnlineHandler | MessageHandler | ErrorHandler | ExitHandler ): void { - this.worker.once(event, listener) + this.worker.once(event, handler) } /** @inheritdoc */ diff --git a/src/pools/worker.ts b/src/pools/worker.ts index da4cf172..be677a04 100644 --- a/src/pools/worker.ts +++ b/src/pools/worker.ts @@ -206,7 +206,7 @@ export interface IWorker { */ readonly threadId?: number /** - * Registers an event listener. + * Registers an event handler. * * @param event - The event. * @param handler - The event handler. @@ -220,7 +220,7 @@ export interface IWorker { | ExitHandler ) => void /** - * Registers once an event listener. + * Registers once an event handler. * * @param event - The event. * @param handler - The event handler. @@ -348,11 +348,11 @@ export interface IWorkerNode * Registers a worker event handler. * * @param event - The event. - * @param listener - The event listener. + * @param handler - The event handler. */ readonly registerWorkerEventHandler: ( event: string, - listener: + handler: | OnlineHandler | MessageHandler | ErrorHandler @@ -362,11 +362,11 @@ export interface IWorkerNode * Registers once a worker event handler. * * @param event - The event. - * @param listener - The event listener. + * @param handler - The event handler. */ readonly registerOnceWorkerEventHandler: ( event: string, - listener: + handler: | OnlineHandler | MessageHandler | ErrorHandler -- 2.34.1