X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fpools%2Fworker.ts;h=58610eaaddacc2beea93809f80675bb8530010c0;hb=eb8afc8aca35901acd45efb54f41e157c098f23e;hp=055a326ad6448add8c87d9a0bdfed8b325066770;hpb=ccd73e075194fac1cf6e1b736f1556b199c95bc5;p=poolifier.git diff --git a/src/pools/worker.ts b/src/pools/worker.ts index 055a326a..58610eaa 100644 --- a/src/pools/worker.ts +++ b/src/pools/worker.ts @@ -1,4 +1,5 @@ import type { CircularArray } from '../circular-array' +import type { Task } from '../utility-types' /** * Callback invoked if the worker has received a message. @@ -29,35 +30,6 @@ export type ExitHandler = ( exitCode: number ) => void -/** - * Message object that is passed as a task between main worker and worker. - * - * @typeParam Data - Type of data sent to the worker. This can only be structured-cloneable data. - * @internal - */ -export interface Task { - /** - * Worker id. - */ - readonly workerId: number - /** - * Task name. - */ - readonly name?: string - /** - * Task input data that will be passed to the worker. - */ - readonly data?: Data - /** - * Timestamp. - */ - readonly timestamp?: number - /** - * Message UUID. - */ - readonly id?: string -} - /** * Measurement statistics. *