repositories
/
poolifier.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix: fix worker function type definition and validation
[poolifier.git]
/
src
/
worker
/
cluster-worker.ts
diff --git
a/src/worker/cluster-worker.ts
b/src/worker/cluster-worker.ts
index 655520ccedb84aeccc0c1231dfb7c4566747e2c0..1d2729812f905d9f9724e5bf9106358ae8aa893a 100644
(file)
--- a/
src/worker/cluster-worker.ts
+++ b/
src/worker/cluster-worker.ts
@@
-28,7
+28,10
@@
export class ClusterWorker<
* @param fn - Function processed by the worker when the pool's `execution` function is invoked.
* @param opts - Options for the worker.
*/
* @param fn - Function processed by the worker when the pool's `execution` function is invoked.
* @param opts - Options for the worker.
*/
- public constructor (fn: (data: Data) => Response, opts: WorkerOptions = {}) {
+ public constructor (
+ fn: (data: Data) => Response | Promise<Response>,
+ opts: WorkerOptions = {}
+ ) {
super(
'worker-cluster-pool:poolifier',
cluster.isPrimary,
super(
'worker-cluster-pool:poolifier',
cluster.isPrimary,