repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
build(ci): fix internal benchmark
[poolifier.git]
/
src
/
worker
/
thread-worker.ts
diff --git
a/src/worker/thread-worker.ts
b/src/worker/thread-worker.ts
index 8d30ef21a8874dcfb6802e2436a7d6033a4fa8ec..d5ce3a2f130da3efbe81f0aa0e3b3e7394033822 100644
(file)
--- a/
src/worker/thread-worker.ts
+++ b/
src/worker/thread-worker.ts
@@
-42,7
+42,7
@@
export class ThreadWorker<
opts: WorkerOptions = {}
) {
super(
opts: WorkerOptions = {}
) {
super(
- '
worker-thread-pool:poolifi
er',
+ '
poolifier:thread-work
er',
isMainThread,
parentPort as MessagePort,
taskFunctions,
isMainThread,
parentPort as MessagePort,
taskFunctions,
@@
-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,
- taskFunctions: this.listTaskFunctions(),
- workerId: this.id
+ taskFunctionNames: this.listTaskFunctionNames()
})
} catch {
this.sendToMainWorker({
ready: false,
})
} catch {
this.sendToMainWorker({
ready: false,
- taskFunctions: this.listTaskFunctions(),
- workerId: this.id
+ taskFunctionNames: this.listTaskFunctionNames()
})
}
}
})
}
}
@@
-89,11
+87,14
@@
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 */
- protected handleError (e: Error | string): string {
- return e as string
+ /**
+ * @inheritDoc
+ * @override
+ */
+ protected handleError (error: Error | string): string {
+ return error as string
}
}
}
}