X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fpools%2Fcluster%2Ffixed.ts;h=c7c95c4b3dad537b39dfd44d37481178035fcb4c;hb=7daf8b1ee6ee28ba8c39c63067cf7071f8638177;hp=8e264359b2ceed7a5efeab91d1488112b4f1dcb7;hpb=81c02522f2c5538a8e5ce341678724132d4da8ba;p=poolifier.git diff --git a/src/pools/cluster/fixed.ts b/src/pools/cluster/fixed.ts index 8e264359..c7c95c4b 100644 --- a/src/pools/cluster/fixed.ts +++ b/src/pools/cluster/fixed.ts @@ -64,7 +64,7 @@ export class FixedClusterPool< this.flushTasksQueue(workerNodeKey) // FIXME: wait for tasks to be finished const worker = this.workerNodes[workerNodeKey].worker - const workerExitPromise = new Promise(resolve => { + const waitWorkerExit = new Promise((resolve) => { worker.on('exit', () => { resolve() }) @@ -72,9 +72,9 @@ export class FixedClusterPool< worker.on('disconnect', () => { worker.kill() }) - this.sendToWorker(workerNodeKey, { kill: true, workerId: worker.id }) + await this.sendKillMessageToWorker(workerNodeKey, worker.id) worker.disconnect() - await workerExitPromise + await waitWorkerExit } /** @inheritDoc */ @@ -116,16 +116,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()