From: Jérôme Benoit Date: Sat, 16 Dec 2023 13:24:33 +0000 (+0100) Subject: refactor: cleanup handler naming X-Git-Tag: v3.1.0~2 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=88af9bf11e70a785747f7511e26d13355ba9deb7;p=poolifier.git refactor: cleanup handler naming Signed-off-by: Jérôme Benoit --- 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