X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fpools%2Fcluster%2Ffixed.ts;h=75c0853586c21739ff217eb3be4e63c64e7bb271;hb=9fe8fd698590c2494dc6793cfd8c08026fe88a31;hp=9022c7025961e9fc206358a48843c9fc5070b0be;hpb=1e3214b63e262557aadebf3c57e8388de6a4bbe4;p=poolifier.git diff --git a/src/pools/cluster/fixed.ts b/src/pools/cluster/fixed.ts index 9022c702..75c08535 100644 --- a/src/pools/cluster/fixed.ts +++ b/src/pools/cluster/fixed.ts @@ -63,7 +63,8 @@ export class FixedClusterPool< protected async destroyWorkerNode (workerNodeKey: number): Promise { this.flushTasksQueue(workerNodeKey) // FIXME: wait for tasks to be finished - const worker = this.workerNodes[workerNodeKey].worker + const workerNode = this.workerNodes[workerNodeKey] + const worker = workerNode.worker const waitWorkerExit = new Promise((resolve) => { worker.on('exit', () => { resolve() @@ -72,7 +73,10 @@ export class FixedClusterPool< worker.on('disconnect', () => { worker.kill() }) - await this.sendKillMessageToWorker(workerNodeKey, worker.id) + await this.sendKillMessageToWorker( + workerNodeKey, + workerNode.info.id as number + ) worker.disconnect() await waitWorkerExit } @@ -89,7 +93,7 @@ export class FixedClusterPool< protected sendStartupMessageToWorker (workerNodeKey: number): void { this.sendToWorker(workerNodeKey, { ready: false, - workerId: this.workerNodes[workerNodeKey].worker.id + workerId: this.workerNodes[workerNodeKey].info.id as number }) } @@ -116,16 +120,6 @@ export class FixedClusterPool< return WorkerTypes.cluster } - /** @inheritDoc */ - protected get minSize (): number { - return this.numberOfWorkers - } - - /** @inheritDoc */ - protected get maxSize (): number { - return this.numberOfWorkers - } - /** @inheritDoc */ protected get busy (): boolean { return this.internalBusy()