X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fpools%2Fcluster%2Ffixed.ts;h=1fea176c4f3884c1ce4778f891d059d9f48bbbde;hb=eceaf36f69c97b0376194a849e77f6ea15fb8f7b;hp=63f129f6a7d09323db3390ffdd61b1fd6918c1d4;hpb=f8b3d84c1c95773a1e18d2c025d89d73c4f2ab15;p=poolifier.git diff --git a/src/pools/cluster/fixed.ts b/src/pools/cluster/fixed.ts index 63f129f6..1fea176c 100644 --- a/src/pools/cluster/fixed.ts +++ b/src/pools/cluster/fixed.ts @@ -1,8 +1,8 @@ import cluster, { type Worker } from 'node:cluster' -import type { MessageValue } from '../../utility-types' -import { AbstractPool } from '../abstract-pool' -import { type PoolOptions, type PoolType, PoolTypes } from '../pool' -import { type WorkerType, WorkerTypes } from '../worker' +import type { MessageValue } from '../../utility-types.js' +import { AbstractPool } from '../abstract-pool.js' +import { type PoolOptions, type PoolType, PoolTypes } from '../pool.js' +import { type WorkerType, WorkerTypes } from '../worker.js' /** * Options for a poolifier cluster pool. @@ -52,10 +52,10 @@ export class FixedClusterPool< workerNodeKey: number, message: MessageValue ): void { - this.workerNodes[workerNodeKey].worker.send({ + this.workerNodes[workerNodeKey]?.worker.send({ ...message, - workerId: this.getWorkerInfo(workerNodeKey).id as number - }) + workerId: this.getWorkerInfo(workerNodeKey)?.id + } satisfies MessageValue) } /** @inheritDoc */