X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fworker%2Fthread-worker.ts;h=e208eb4063656dccf1ed25a8c12463c6de1302e5;hb=29d8b961b1907797d251871a97092973d342c63c;hp=dc628bed08fa4b23f29724f88f41484b0097afef;hpb=d655027ba35d40bd823574f630debc7c3a860638;p=poolifier.git diff --git a/src/worker/thread-worker.ts b/src/worker/thread-worker.ts index dc628bed..e208eb40 100644 --- a/src/worker/thread-worker.ts +++ b/src/worker/thread-worker.ts @@ -7,7 +7,7 @@ import { import type { MessageValue } from '../utility-types' import { AbstractWorker } from './abstract-worker' import type { WorkerOptions } from './worker-options' -import type { TaskFunctions, WorkerFunction } from './worker-functions' +import type { TaskFunction, TaskFunctions } from './task-functions' /** * A thread worker used by a poolifier `ThreadPool`. @@ -38,9 +38,7 @@ export class ThreadWorker< * @param opts - Options for the worker. */ public constructor ( - taskFunctions: - | WorkerFunction - | TaskFunctions, + taskFunctions: TaskFunction | TaskFunctions, opts: WorkerOptions = {} ) { super( @@ -55,7 +53,6 @@ export class ThreadWorker< /** @inheritDoc */ protected handleReadyMessage (message: MessageValue): void { if ( - !this.isMain && message.workerId === this.id && message.ready != null && message.port != null