repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Take change from jerome
[poolifier.git]
/
src
/
pools
/
cluster
/
fixed.ts
diff --git
a/src/pools/cluster/fixed.ts
b/src/pools/cluster/fixed.ts
index 0d8021ebf08f0011142a442cbc21175def17db87..7cc3bf53950870a0ac2ee6e1a99871bfb72e4214 100644
(file)
--- a/
src/pools/cluster/fixed.ts
+++ b/
src/pools/cluster/fixed.ts
@@
-59,26
+59,26
@@
export class FixedClusterPool<
}
protected destroyWorker (worker: Worker): void {
}
protected destroyWorker (worker: Worker): void {
+ this.sendToWorker(worker, { kill: 1 })
worker.kill()
worker.kill()
- // FIXME: The tests are currently failing, so these must be changed first
}
protected sendToWorker (worker: Worker, message: MessageValue<Data>): void {
worker.send(message)
}
}
protected sendToWorker (worker: Worker, message: MessageValue<Data>): void {
worker.send(message)
}
- protected registerWorkerMessageListener (
-
port
: Worker,
- listener: (message: MessageValue<
Respons
e>) => void
+ protected registerWorkerMessageListener
<Message extends Data | Response>
(
+
worker
: Worker,
+ listener: (message: MessageValue<
Messag
e>) => void
): void {
): void {
-
port
.on('message', listener)
+
worker
.on('message', listener)
}
}
- protected unregisterWorkerMessageListener (
-
port
: Worker,
- listener: (message: MessageValue<
Respons
e>) => void
+ protected unregisterWorkerMessageListener
<Message extends Data | Response>
(
+
worker
: Worker,
+ listener: (message: MessageValue<
Messag
e>) => void
): void {
): void {
-
port
.removeListener('message', listener)
+
worker
.removeListener('message', listener)
}
protected createWorker (): Worker {
}
protected createWorker (): Worker {