* @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,