From: Jérôme Benoit Date: Sat, 1 Jul 2023 17:29:20 +0000 (+0200) Subject: docs: refine code documentation X-Git-Tag: v2.6.7~20 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=ab80dc4621654ddd6f327ffec8db9a425e56e6d1;hp=--cc;p=poolifier.git docs: refine code documentation Signed-off-by: Jérôme Benoit --- ab80dc4621654ddd6f327ffec8db9a425e56e6d1 diff --git a/src/utils.ts b/src/utils.ts index a6f5fbcc..87c4888d 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -32,7 +32,10 @@ export const DEFAULT_MEASUREMENT_STATISTICS_REQUIREMENTS: MeasurementStatisticsR } /** - * Safe helper to get the host OS optimized maximum pool size. + * Returns safe host OS optimized estimate of the default amount of parallelism a pool should use. + * Always returns a value greater than zero. + * + * @returns The host OS optimized maximum pool size. */ export const availableParallelism = (): number => { let availableParallelism = 1 diff --git a/src/worker/abstract-worker.ts b/src/worker/abstract-worker.ts index 25be4820..2a027269 100644 --- a/src/worker/abstract-worker.ts +++ b/src/worker/abstract-worker.ts @@ -202,7 +202,7 @@ export abstract class AbstractWorker< * Handles an error and convert it to a string so it can be sent back to the main worker. * * @param e - The error raised by the worker. - * @returns Message of the error. + * @returns The error message. */ protected handleError (e: Error | string): string { return e as string