import { Debugger } from '@boost/debug'; import Context from './Context'; import Routine from './Routine'; import Task from './Task'; import Tool from './Tool'; export declare type ExecuteHandler = (task: Task, value?: any) => Promise; export interface AggregatedResponse { errors: Error[]; results: T[]; } export default abstract class Executor { context: Ctx; debug: Debugger; options: Options; parallel: boolean; tool: Tool; constructor(tool: Tool, context: Ctx, options?: Options); /** * Aggregate and partition errors and results into separate collections. */ aggregateResponse(responses: T[]): AggregatedResponse; /** * Execute a routine with the provided value. */ executeRoutine: (routine: Routine, value?: T | undefined) => Promise; /** * Execute a task with the provided value. */ executeTask: (task: Task, value?: T | undefined) => Promise; /** * Run all routines with the defined executor. */ runRoutines(routines: Routine[], value?: T): Promise; /** * Run all tasks with the defined executor. */ runTasks(tasks: Task[], value?: T): Promise; /** * Method to execute tasks. Must be defined in sub-classes. */ abstract run(handler: ExecuteHandler, tasks: Task[], value?: T): Promise; } //# sourceMappingURL=Executor.d.ts.map