parallel-es
Version:
Simple parallelization for EcmaScript
28 lines (27 loc) • 1.61 kB
TypeScript
import { IParallelChainState, IParallelChainEnvironment, IScheduledParallelChainState } from "./parallel-chain-state";
import { IParallelGenerator } from "../generator/parallel-generator";
import { IParallelOperation, IDefaultInitializedParallelOptions } from "../";
import { ParallelEnvironmentDefinition } from "../parallel-environment-definition";
/**
* Parallel chain has been defined but not yet scheduled.
*
* The chain has been created by the user, but non terminating function (reduce, then, catch...) has been called yet.
* @param TElement type of the elements
*/
export declare class PendingParallelChainState<TElement> implements IParallelChainState<TElement> {
generator: IParallelGenerator;
environment: ParallelEnvironmentDefinition;
operations: IParallelOperation[];
options: IDefaultInitializedParallelOptions;
/**
* Creates a new state
* @param generator the generator to use to generate the input elements and split the job
* @param options the options
* @param environment the environment builder that is used to create the environment for the job
* @param operations the operations to perform on the input elements
*/
constructor(generator: IParallelGenerator, options: IDefaultInitializedParallelOptions, environment: ParallelEnvironmentDefinition, operations: IParallelOperation[]);
resolve(): IScheduledParallelChainState<TElement>;
chainOperation<TElementNew>(operation: IParallelOperation): IParallelChainState<TElementNew>;
addEnvironment(environment: IParallelChainEnvironment): IParallelChainState<TElement>;
}