/** * ThreadPool — Manages a pool of Worker Threads for parallel CSV parsing. * * Design decisions: * 1. Warm pool: workers are created ONCE and reused across tasks. * Creating workers is expensive (~10ms each), so we pre-warm them. * * 2. Ordered results: results are collected per-taskId and yielded * in original order, even if workers complete out of order. * * 3. Header broadcast: worker 0 reads the header row and broadcasts * it to all other workers before they start processing. * * 4. Graceful shutdown: destroy() terminates all workers cleanly. */ import type { BatchResult } from "../types/index.js"; import type { CsvSuperProOptions } from "../types/index.js"; export interface ByteRange { start: number; end: number; } export declare class ThreadPool { private readonly threadCount; private readonly filePath; private readonly options; private readonly workers; private headersCache; private headersPromise; private headersResolve; constructor(threadCount: number, filePath: string, options: CsvSuperProOptions); /** * Initialize worker pool */ initialize(): Promise; process(ranges: ByteRange[], batchSize: number): AsyncGenerator; destroy(): Promise; get activeWorkers(): number; } //# sourceMappingURL=thread-pool.d.ts.map