WorkerPool manages a pool of Node.js worker threads for parallel analysis operations.
The worker script is provided by the @angular-modernizer/worker package; pass getWorkerScriptPath() from that package as workerScriptPath.
@angular-modernizer/worker
getWorkerScriptPath()
workerScriptPath
Key Features:
const pool = new WorkerPool({ tsConfigPath: '/path/to/tsconfig.json', maxWorkers: 4, workerHeapLimit: 512});const result = await pool.executeTask({ id: 'task-1', type: 'analyze-rule', filePath: '/path/to/file.ts', ruleIds: ['rule-1', 'rule-2'], pluginIds: ['plugin-architecture']});await pool.terminate(); Copy
const pool = new WorkerPool({ tsConfigPath: '/path/to/tsconfig.json', maxWorkers: 4, workerHeapLimit: 512});const result = await pool.executeTask({ id: 'task-1', type: 'analyze-rule', filePath: '/path/to/file.ts', ruleIds: ['rule-1', 'rule-2'], pluginIds: ['plugin-architecture']});await pool.terminate();
The WorkerPool analysis path is deprecated since 1.1 and will be removed in 2.0; the MCP scans run in a scan worker instead.
Optional
Execute a task on the worker pool. Returns a promise that resolves with the worker result.
Get current worker pool statistics.
Terminate all workers and clean up resources.
WorkerPool manages a pool of Node.js worker threads for parallel analysis operations.
The worker script is provided by the
@angular-modernizer/workerpackage; passgetWorkerScriptPath()from that package asworkerScriptPath.Key Features:
Example
Deprecated
The WorkerPool analysis path is deprecated since 1.1 and will be removed in 2.0; the MCP scans run in a scan worker instead.