From: Jérôme Benoit Date: Thu, 16 Nov 2023 22:09:04 +0000 (+0100) Subject: refactor: move workerId outside task type definition X-Git-Tag: v3.0.6~23 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=7379799cccb092ed5e83b388977a25a8a23ac37b;p=poolifier.git refactor: move workerId outside task type definition Signed-off-by: Jérôme Benoit --- diff --git a/src/pools/pool.ts b/src/pools/pool.ts index af80bcfb..581adc95 100644 --- a/src/pools/pool.ts +++ b/src/pools/pool.ts @@ -241,7 +241,7 @@ export interface IPool< * * @param data - The optional task input data for the specified task function. This can only be structured-cloneable data. * @param name - The optional name of the task function to execute. If not specified, the default task function will be executed. - * @param transferList - An optional array of transferable objects to transfer ownership of. Ownership of the transferred objects is given to the pool's worker_threads worker and they should not be used in the main thread afterwards. + * @param transferList - An optional array of transferable objects to transfer ownership of. Ownership of the transferred objects is given to the chosen pool's worker_threads worker and they should not be used in the main thread afterwards. * @returns Promise that will be fulfilled when the task is completed. */ readonly execute: ( diff --git a/src/utility-types.ts b/src/utility-types.ts index 48988c08..60ec2f54 100644 --- a/src/utility-types.ts +++ b/src/utility-types.ts @@ -69,10 +69,6 @@ export interface WorkerStatistics { * @internal */ export interface Task { - /** - * Worker id. - */ - readonly workerId?: number /** * Task name. */ @@ -104,6 +100,10 @@ export interface Task { */ export interface MessageValue extends Task { + /** + * Worker id. + */ + readonly workerId?: number /** * Kill code. */