X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Futility-types.ts;h=a418ee885f903d3bb9838c0c34be0e6bbce43524;hb=refs%2Ftags%2Fv2.6.29;hp=be0ed287633b24e211e46024f736aefc033701e3;hpb=e5d3809a1257001dde331c074b61c5ddb01a5844;p=poolifier.git diff --git a/src/utility-types.ts b/src/utility-types.ts index be0ed287..a418ee88 100644 --- a/src/utility-types.ts +++ b/src/utility-types.ts @@ -1,5 +1,5 @@ import type { EventLoopUtilization } from 'node:perf_hooks' -import type { MessagePort } from 'node:worker_threads' +import type { MessagePort, TransferListItem } from 'node:worker_threads' import type { KillBehavior } from './worker/worker-options' /** @@ -75,14 +75,18 @@ export interface Task { * Task input data that will be passed to the worker. */ readonly data?: Data + /** + * Array of transferable objects. + */ + readonly transferList?: TransferListItem[] /** * Timestamp. */ readonly timestamp?: number /** - * Message UUID. + * Task UUID. */ - readonly id?: string + readonly taskId?: string } /** @@ -97,7 +101,7 @@ export interface MessageValue /** * Kill code. */ - readonly kill?: KillBehavior | true + readonly kill?: KillBehavior | true | 'success' | 'failure' /** * Task error. */ @@ -106,6 +110,10 @@ export interface MessageValue * Task performance. */ readonly taskPerformance?: TaskPerformance + /** + * Task function names. + */ + readonly taskFunctions?: string[] /** * Whether the worker computes the given statistics or not. */