From 7379799cccb092ed5e83b388977a25a8a23ac37b Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Thu, 16 Nov 2023 23:09:04 +0100 Subject: [PATCH] refactor: move workerId outside task type definition MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/pools/pool.ts | 2 +- src/utility-types.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) 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. */ -- 2.34.1