Creates the WorkerManager
The workerFactory needs to be a callback:
() => spawn(new Worker(workerPath))
The spawn and Worker can be imported from threads
The workerPath must point to a worker script
The workerPath can be either an absolute path or relative path
If it is a relative path, it has to be relative to the file location where
the function expression is defined
If cores is set to 0, this creates a useless worker pool
Use undefined to mean using all cores
Creates the WorkerManager The workerFactory needs to be a callback:
() => spawn(new Worker(workerPath))
Thespawn
andWorker
can be imported fromthreads
TheworkerPath
must point to a worker script TheworkerPath
can be either an absolute path or relative path If it is a relative path, it has to be relative to the file location where the function expression is defined Ifcores
is set to 0, this creates a useless worker pool Useundefined
to mean using all cores