import type { MessageValue } from '../utility-types.js'
import { AbstractWorker } from './abstract-worker.js'
import type { MessageValue } from '../utility-types.js'
import { AbstractWorker } from './abstract-worker.js'
*
* If you use a `DynamicThreadPool` the extra workers that were created will be terminated,
* but the minimum number of workers will be guaranteed.
*
* If you use a `DynamicThreadPool` the extra workers that were created will be terminated,
* but the minimum number of workers will be guaranteed.
* @typeParam Data - Type of data this worker receives from pool's execution. This can only be structured-cloneable data.
* @typeParam Response - Type of response the worker sends back to the main thread. This can only be structured-cloneable data.
* @author [Alessandro Pio Ardizio](https://github.com/pioardi)
* @typeParam Data - Type of data this worker receives from pool's execution. This can only be structured-cloneable data.
* @typeParam Response - Type of response the worker sends back to the main thread. This can only be structured-cloneable data.
* @author [Alessandro Pio Ardizio](https://github.com/pioardi)
* @param taskFunctions - Task function(s) processed by the worker when the pool's `execution` function is invoked.
* @param opts - Options for the worker.
*/
* @param taskFunctions - Task function(s) processed by the worker when the pool's `execution` function is invoked.
* @param opts - Options for the worker.
*/
taskFunctions: TaskFunction<Data, Response> | TaskFunctions<Data, Response>,
opts: WorkerOptions = {}
) {
taskFunctions: TaskFunction<Data, Response> | TaskFunctions<Data, Response>,
opts: WorkerOptions = {}
) {
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
- super(isMainThread, parentPort!, taskFunctions, opts)
+ super(isMainThread, parentPort, taskFunctions, opts)