X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fpools%2Fcluster%2Ffixed.ts;h=4a8cb4f1eeeafeb59adf1e30c5d678328cb19b70;hb=bcf1c155ec2e2d9208c8f818abd031662bd61d7f;hp=b1930f2f7f5ec59aa509dcaba578d595d5e6aaad;hpb=d087803425ae5b3577028029dd1d2dae67d7f63b;p=poolifier.git diff --git a/src/pools/cluster/fixed.ts b/src/pools/cluster/fixed.ts index b1930f2f..4a8cb4f1 100644 --- a/src/pools/cluster/fixed.ts +++ b/src/pools/cluster/fixed.ts @@ -1,8 +1,9 @@ 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 +53,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 */ @@ -95,7 +96,9 @@ export class FixedClusterPool< } /** @inheritDoc */ - protected checkAndEmitDynamicWorkerCreationEvents (): void {} + protected checkAndEmitDynamicWorkerCreationEvents (): void { + /* noop */ + } /** @inheritDoc */ protected get type (): PoolType {