X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Futility-types.ts;h=1783b4e6f36adfa9f778cbd74b3ce46975bb40a2;hb=da70a35218e951ae2a88a7a051b822622999a1a8;hp=123b5d6ea4fa397982c6195de0d9ccd95ba0c1df;hpb=15a8bf08edd98c1f9ef4a4d3f89d2cffbe30852e;p=poolifier.git diff --git a/src/utility-types.ts b/src/utility-types.ts index 123b5d6e..1783b4e6 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,6 +75,10 @@ export interface Task { * Task input data that will be passed to the worker. */ readonly data?: Data + /** + * Array of transferable objects. + */ + readonly transferList?: TransferListItem[] /** * Timestamp. */ @@ -97,7 +101,7 @@ export interface MessageValue /** * Kill code. */ - readonly kill?: KillBehavior | true + readonly kill?: KillBehavior | true | 'success' | 'failure' /** * Task error. */