UNPKG

@rushstack/operation-graph

Version:

Library for managing and executing operations in a directed acyclic graph.

46 lines 1.77 kB
/// <reference types="node" /> import type { ITerminal } from '@rushstack/terminal'; import type { Operation } from './Operation'; import { OperationStatus } from './OperationStatus'; /** * Options for the current run. * * @beta */ export interface IOperationExecutionOptions { abortSignal: AbortSignal; parallelism: number; terminal: ITerminal; requestRun?: (requestor?: string) => void; } /** * A class which manages the execution of a set of tasks with interdependencies. * Initially, and at the end of each task execution, all unblocked tasks * are added to a ready queue which is then executed. This is done continually until all * tasks are complete, or prematurely fails if any of the tasks fail. * * @beta */ export declare class OperationExecutionManager { /** * The set of operations that will be executed */ private readonly _operations; /** * Group records are metadata-only entities used for tracking the start and end of a set of related tasks. * This is the only extent to which the operation graph is aware of Heft phases. */ private readonly _groupRecordByName; /** * The total number of non-silent operations in the graph. * Silent operations are generally used to simplify the construction of the graph. */ private readonly _trackedOperationCount; constructor(operations: ReadonlySet<Operation>); /** * Executes all operations which have been registered, returning a promise which is resolved when all the * operations are completed successfully, or rejects when any operation fails. */ executeAsync(executionOptions: IOperationExecutionOptions): Promise<OperationStatus>; } //# sourceMappingURL=OperationExecutionManager.d.ts.map