X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fworker%2Ftask-functions.ts;h=2fd951fb2ac03d71b820a1673561630f0c9d7736;hb=3b594fe1b0f89d6665da2eb2ebdc14eb7628fe70;hp=8999b69decbe215d279ce09cce457e6b5bca633f;hpb=c99df098ff02de4aeb34a422f2ab7c525e7c37ae;p=poolifier.git diff --git a/src/worker/task-functions.ts b/src/worker/task-functions.ts index 8999b69d..2fd951fb 100644 --- a/src/worker/task-functions.ts +++ b/src/worker/task-functions.ts @@ -2,10 +2,8 @@ import type { WorkerChoiceStrategy } from '../pools/selection-strategies/selecti /** * Task synchronous function that can be executed. - * * @param data - Data sent to the worker. * @returns Execution response. - * * @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. */ @@ -16,10 +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. * @returns Execution response promise. - * * @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. */ @@ -30,7 +26,6 @@ export type TaskAsyncFunction = ( /** * Task function that can be executed. * This function can be synchronous or asynchronous. - * * @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. */ @@ -40,7 +35,6 @@ export type TaskFunction = /** * Task function object. - * * @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. */ @@ -62,14 +56,13 @@ export interface TaskFunctionObject { /** * Tasks functions that can be executed. * The key is the name of the task function or task function object. - * The value is the function or task function object. - * + * The value is the task function or task function object. * @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. */ export type TaskFunctions = Record< -string, -TaskFunction | TaskFunctionObject + string, + TaskFunction | TaskFunctionObject > /**