repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' into feature/task-functions
[poolifier.git]
/
src
/
pools
/
cluster
/
fixed.ts
diff --git
a/src/pools/cluster/fixed.ts
b/src/pools/cluster/fixed.ts
index 75c0853586c21739ff217eb3be4e63c64e7bb271..9470cccd857321388d70e0bf7f09de1a20505cfe 100644
(file)
--- a/
src/pools/cluster/fixed.ts
+++ b/
src/pools/cluster/fixed.ts
@@
-65,7
+65,7
@@
export class FixedClusterPool<
// FIXME: wait for tasks to be finished
const workerNode = this.workerNodes[workerNodeKey]
const worker = workerNode.worker
// FIXME: wait for tasks to be finished
const workerNode = this.workerNodes[workerNodeKey]
const worker = workerNode.worker
- const waitWorkerExit = new Promise<void>(
(resolve)
=> {
+ const waitWorkerExit = new Promise<void>(
resolve
=> {
worker.on('exit', () => {
resolve()
})
worker.on('exit', () => {
resolve()
})
@@
-73,10
+73,7
@@
export class FixedClusterPool<
worker.on('disconnect', () => {
worker.kill()
})
worker.on('disconnect', () => {
worker.kill()
})
- await this.sendKillMessageToWorker(
- workerNodeKey,
- workerNode.info.id as number
- )
+ await this.sendKillMessageToWorker(workerNodeKey)
worker.disconnect()
await waitWorkerExit
}
worker.disconnect()
await waitWorkerExit
}
@@
-86,14
+83,16
@@
export class FixedClusterPool<
workerNodeKey: number,
message: MessageValue<Data>
): void {
workerNodeKey: number,
message: MessageValue<Data>
): void {
- this.workerNodes[workerNodeKey].worker.send(message)
+ this.workerNodes[workerNodeKey].worker.send({
+ ...message,
+ workerId: this.workerNodes[workerNodeKey].info.id as number
+ })
}
/** @inheritDoc */
protected sendStartupMessageToWorker (workerNodeKey: number): void {
this.sendToWorker(workerNodeKey, {
}
/** @inheritDoc */
protected sendStartupMessageToWorker (workerNodeKey: number): void {
this.sendToWorker(workerNodeKey, {
- ready: false,
- workerId: this.workerNodes[workerNodeKey].info.id as number
+ ready: false
})
}
})
}