From: Jérôme Benoit Date: Wed, 25 Oct 2023 20:04:11 +0000 (+0200) Subject: docs: enchance code comments X-Git-Tag: v3.0.5~4 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=09b75fef0162fa1a333d3c61c6da735b771ed801;hp=-c;p=poolifier.git docs: enchance code comments Signed-off-by: Jérôme Benoit --- 09b75fef0162fa1a333d3c61c6da735b771ed801 diff --git a/src/pools/worker.ts b/src/pools/worker.ts index 03cecce8..b3e02f3c 100644 --- a/src/pools/worker.ts +++ b/src/pools/worker.ts @@ -4,11 +4,15 @@ import type { Task } from '../utility-types' /** * Callback invoked when the worker has started successfully. + * + * @typeParam Worker - Type of worker. */ export type OnlineHandler = (this: Worker) => void /** * Callback invoked if the worker has received a message. + * + * @typeParam Worker - Type of worker. */ export type MessageHandler = ( this: Worker, @@ -17,6 +21,8 @@ export type MessageHandler = ( /** * Callback invoked if the worker raised an error. + * + * @typeParam Worker - Type of worker. */ export type ErrorHandler = ( this: Worker, @@ -25,6 +31,8 @@ export type ErrorHandler = ( /** * Callback invoked when the worker exits successfully. + * + * @typeParam Worker - Type of worker. */ export type ExitHandler = ( this: Worker, diff --git a/src/worker/task-functions.ts b/src/worker/task-functions.ts index ef9e1f0a..b912f05c 100644 --- a/src/worker/task-functions.ts +++ b/src/worker/task-functions.ts @@ -1,6 +1,8 @@ /** * Task synchronous function that can be executed. * + * @param data - Data sent to the worker. + * * @typeParam Data - Type of data sent to the worker. This can only be structured-cloneable data. * @typeParam Response - Type of execution response. This can only be structured-cloneable data. */ @@ -12,6 +14,8 @@ export type TaskSyncFunction = ( * Task asynchronous function that can be executed. * This function must return a promise. * + * @param data - Data sent to the worker. + * * @typeParam Data - Type of data sent to the worker. This can only be structured-cloneable data. * @typeParam Response - Type of execution response. This can only be structured-cloneable data. */