repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
refactor: cleanup workerId usage in messaging
[poolifier.git]
/
src
/
worker
/
thread-worker.ts
diff --git
a/src/worker/thread-worker.ts
b/src/worker/thread-worker.ts
index ede0b3b5602f6335e2fc0c3409a719fd5edbf5b6..ec6b6a0aa65ac60adb1f089a4923894798953525 100644
(file)
--- a/
src/worker/thread-worker.ts
+++ b/
src/worker/thread-worker.ts
@@
-62,14
+62,12
@@
export class ThreadWorker<
this.port.on('message', this.messageListener.bind(this))
this.sendToMainWorker({
ready: true,
this.port.on('message', this.messageListener.bind(this))
this.sendToMainWorker({
ready: true,
- taskFunctionNames: this.listTaskFunctionNames(),
- workerId: this.id
+ taskFunctionNames: this.listTaskFunctionNames()
})
} catch {
this.sendToMainWorker({
ready: false,
})
} catch {
this.sendToMainWorker({
ready: false,
- taskFunctionNames: this.listTaskFunctionNames(),
- workerId: this.id
+ taskFunctionNames: this.listTaskFunctionNames()
})
}
}
})
}
}
@@
-89,7
+87,7
@@
export class ThreadWorker<
/** @inheritDoc */
protected sendToMainWorker (message: MessageValue<Response>): void {
/** @inheritDoc */
protected sendToMainWorker (message: MessageValue<Response>): void {
- this.port.postMessage(
message
)
+ this.port.postMessage(
{ ...message, workerId: this.id }
)
}
/** @inheritDoc */
}
/** @inheritDoc */