X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fworker%2Fthread-worker.ts;h=ad2bc644220289c596420513208dd2b77b5db00d;hb=d4aeae5aa9e260c8c2f6d28f3133de368552c108;hp=ac775a09842c970629a07ef29fa5b961a8e53a9c;hpb=afc003b20097712625ffd053e256ef5336e27b6e;p=poolifier.git diff --git a/src/worker/thread-worker.ts b/src/worker/thread-worker.ts index ac775a09..ad2bc644 100644 --- a/src/worker/thread-worker.ts +++ b/src/worker/thread-worker.ts @@ -28,7 +28,10 @@ export class ThreadWorker< * @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, + opts: WorkerOptions = {} + ) { super('worker-thread-pool:poolifier', isMainThread, fn, parentPort, opts) }