/** * Parallel execution utilities for RLM sub-calls. * Provides concurrency control, timeout handling, and failure isolation. */ /** * Options for parallel execution. */ export interface ParallelOptions { /** Maximum number of concurrent operations */ concurrency: number; /** Per-item timeout in milliseconds */ timeout?: number; } /** * Result type for parallel map operations. * Each result is either a success with a value or a failure with an error message. */ export type ParallelResult = { success: true; value: T; } | { success: false; error: string; }; /** * Execute a function on each item in parallel with concurrency control. * * Uses Promise.allSettled for failure isolation - one failure doesn't abort others. * Results are returned in the same order as input items. * * @param items - Array of items to process * @param fn - Async function to execute on each item * @param options - Parallel execution options * @returns Array of results in input order (success or failure per item) * * @example * const results = await parallelMap( * [1, 2, 3], * async (n) => n * 2, * { concurrency: 2 } * ); * // [{ success: true, value: 2 }, { success: true, value: 4 }, { success: true, value: 6 }] */ export declare function parallelMap(items: T[], fn: (item: T, index: number) => Promise, options: ParallelOptions): Promise[]>; //# sourceMappingURL=parallel.d.ts.map