/// import Context from '../Context'; import Executor, { AggregatedResponse, ExecuteHandler } from '../Executor'; import Task from '../Task'; import Tool from '../Tool'; export interface PoolExecutorOptions { concurrency?: number; fifo?: boolean; timeout?: number; } export default class PoolExecutor extends Executor { handler: ExecuteHandler | null; parallel: boolean; queue: Task[]; resolver: ((response: AggregatedResponse) => void) | null; results: any[]; running: Task[]; timeoutTimer?: NodeJS.Timer; constructor(tool: Tool, context: Ctx, options?: PoolExecutorOptions); /** * Execute tasks using a pool with a max concurrency. */ run(handler: ExecuteHandler, tasks: Task[], value?: T): Promise>; /** * Resolve the execution with the current results. */ resolve(): void; /** * Run a task from the queue, and start the next task one it passes or fails. */ runItem(value?: T): Promise; /** * Run the next task if there are tasks available in the queue, and the max concurrency isn't met. * Otherwise, resolve and exit the current pool. */ nextItem(value?: T): void; } //# sourceMappingURL=Pool.d.ts.map