/** * @fileoverview ParallelExecutor (SPEC Section 7.2) * * Parallel execution with concurrency control. * * Per SPEC Section 11.7 (PEX-*): * - PEX-1: Results MUST be in input order * - PEX-2: graphs[i] corresponds to chunks[i] * - PEX-3: Results SHALL NOT be returned in completion (arrival) order * * @module pipeline/parallel-executor */ /** * Options for ParallelExecutor. */ export interface ParallelExecutorOptions { /** Maximum concurrent executions */ concurrency: number; /** Timeout per item (ms) */ timeout?: number; /** Error handling policy */ onError?: "fail-fast" | "best-effort"; } /** * Parallel execution with concurrency control. * * Per SPEC Section 7.2: * CRITICAL: Results MUST be in input order (PEX-1). * * @typeParam TIn - Input type * @typeParam TOut - Output type */ export declare class ParallelExecutor { private readonly concurrency; private readonly timeout?; private readonly onError; constructor(options: ParallelExecutorOptions); /** * Execute function on inputs with concurrency control. * * CRITICAL: Results MUST be in input order (PEX-1). * * @param inputs - Input array * @param fn - Async function to execute * @returns Results in same order as inputs * @throws Error if fail-fast and any execution fails */ execute(inputs: TIn[], fn: (input: TIn, index: number) => Promise): Promise; /** * Execute all items using Promise.all. * PEX-1 is guaranteed because Promise.all preserves order. */ private executeAll; /** * Execute with batched concurrency control. * PEX-1 is guaranteed by tracking indices. */ private executeBatched; /** * Wrap promise with timeout if configured. */ private wrapWithTimeout; } /** * Create a ParallelExecutor with default options. */ export declare function createParallelExecutor(options?: Partial): ParallelExecutor; //# sourceMappingURL=parallel-executor.d.ts.map