X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fpools%2Fthread%2Ffixed.ts;h=c9145f571186a9d5783531236414aff7eadd463e;hb=21f710aa73abbb5d90328cfb199adfc0f7a70406;hp=ac629e1fb0ff7f363be0a3fe5107f2b02748c8d8;hpb=6677a3d36e9e7241c54db7cd69daa40f52fcbcb3;p=poolifier.git diff --git a/src/pools/thread/fixed.ts b/src/pools/thread/fixed.ts index ac629e1f..c9145f57 100644 --- a/src/pools/thread/fixed.ts +++ b/src/pools/thread/fixed.ts @@ -6,13 +6,8 @@ import { } from 'node:worker_threads' import type { MessageValue } from '../../utility-types' import { AbstractPool } from '../abstract-pool' -import { - type PoolOptions, - type PoolType, - PoolTypes, - type WorkerType, - WorkerTypes -} from '../pool' +import { type PoolOptions, type PoolType, PoolTypes } from '../pool' +import { type WorkerType, WorkerTypes } from '../worker' /** * Options for a poolifier thread pool. @@ -60,7 +55,7 @@ export class FixedThreadPool< /** @inheritDoc */ protected async destroyWorker (worker: Worker): Promise { - this.sendToWorker(worker, { kill: 1 }) + this.sendToWorker(worker, { kill: true, workerId: worker.threadId }) await worker.terminate() }