repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
refactor: cleanup default arguments handling
[poolifier.git]
/
src
/
worker
/
cluster-worker.ts
diff --git
a/src/worker/cluster-worker.ts
b/src/worker/cluster-worker.ts
index 0fd9095625fa7ab6bf4bd9203cbf9b4e2ef03348..d972692ec6eb4f182479cac008c47a1f20b75d8d 100644
(file)
--- a/
src/worker/cluster-worker.ts
+++ b/
src/worker/cluster-worker.ts
@@
-32,13
+32,7
@@
export class ClusterWorker<
taskFunctions: TaskFunction<Data, Response> | TaskFunctions<Data, Response>,
opts: WorkerOptions = {}
) {
taskFunctions: TaskFunction<Data, Response> | TaskFunctions<Data, Response>,
opts: WorkerOptions = {}
) {
- super(
- 'poolifier:cluster-worker',
- cluster.isPrimary,
- cluster.worker as Worker,
- taskFunctions,
- opts
- )
+ super(cluster.isPrimary, cluster.worker as Worker, taskFunctions, opts)
}
/** @inheritDoc */
}
/** @inheritDoc */
@@
-65,7
+59,9
@@
export class ClusterWorker<
}
/** @inheritDoc */
}
/** @inheritDoc */
- protected sendToMainWorker (message: MessageValue<Response>): void {
+ protected readonly sendToMainWorker = (
+ message: MessageValue<Response>
+ ): void => {
this.getMainWorker().send({ ...message, workerId: this.id })
}
}
this.getMainWorker().send({ ...message, workerId: this.id })
}
}