X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fpools%2Fworker.ts;h=4c877bc8b1dcc58871a55cd70c87871d918c4596;hb=refs%2Ftags%2Fv2.7.4;hp=5cd58b28be9b2ee3ef44be54af4e2fb6bdcddca2;hpb=5b49e86408b36f63d5076a086e2feca64a9690d0;p=poolifier.git diff --git a/src/pools/worker.ts b/src/pools/worker.ts index 5cd58b28..4c877bc8 100644 --- a/src/pools/worker.ts +++ b/src/pools/worker.ts @@ -144,7 +144,7 @@ export interface WorkerInfo { /** * Task function names. */ - taskFunctions?: string[] + taskFunctionNames?: string[] } /** @@ -171,6 +171,15 @@ export interface WorkerUsage { readonly elu: EventLoopUtilizationMeasurementStatistics } +/** + * Worker choice strategy data. + * + * @internal + */ +export interface StrategyData { + virtualTaskEndTimestamp?: number +} + /** * Worker interface. */ @@ -227,6 +236,11 @@ export interface IWorkerNode { * Worker usage statistics. */ readonly usage: WorkerUsage + /** + * Worker choice strategy data. + * This is used to store data that is specific to the worker choice strategy. + */ + strategyData?: StrategyData /** * Message channel (worker_threads only). */ @@ -301,4 +315,11 @@ export interface IWorkerNode { * @returns The task function worker usage statistics if the task function worker usage statistics are initialized, `undefined` otherwise. */ readonly getTaskFunctionWorkerUsage: (name: string) => WorkerUsage | undefined + /** + * Deletes task function worker usage statistics. + * + * @param name - The task function name. + * @returns `true` if the task function worker usage statistics were deleted, `false` otherwise. + */ + readonly deleteTaskFunctionWorkerUsage: (name: string) => boolean }