X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fpools%2Fcluster%2Ffixed.ts;h=c60266e3d72b623fb9225dcc20882c064d29438c;hb=e9ed6eeed0f1c96d89c1506ee342b3000a95b4ba;hp=b7bf9c1a70bb150d98414571c0820752a8707c9a;hpb=9d9fb7b64a28d150583fe1bcd895893f6736d9d4;p=poolifier.git diff --git a/src/pools/cluster/fixed.ts b/src/pools/cluster/fixed.ts index b7bf9c1a..c60266e3 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. @@ -54,8 +54,8 @@ export class FixedClusterPool< ): void { this.workerNodes[workerNodeKey].worker.send({ ...message, - workerId: this.getWorkerInfo(workerNodeKey).id as number - }) + workerId: this.getWorkerInfo(workerNodeKey)?.id + } satisfies MessageValue) } /** @inheritDoc */ @@ -94,6 +94,11 @@ export class FixedClusterPool< return false } + /** @inheritDoc */ + protected checkAndEmitDynamicWorkerCreationEvents (): void { + /* noop */ + } + /** @inheritDoc */ protected get type (): PoolType { return PoolTypes.fixed