Skip to main content

Interface: ParallelConfig<TInput, TOutput, TProcessors>

Defined in: packages/core/src/pipeline/types.ts:184

Configuration for parallel execution step.

Example​

// Object mode with named results
const config: ParallelConfig<BlogPost, EnrichedPost> = {
processors: {
sentiment: analyzeSentiment,
category: categorizePost,
tags: generateTags
},
merge: (mergeInput) => ({
...mergeInput.original,
sentiment: mergeInput.results.sentiment,
category: mergeInput.results.category,
tags: mergeInput.results.tags
})
};

// Array mode
const config: ParallelConfig<string, ValidationResult> = {
processors: [checkSpelling, checkGrammar, checkReadability],
merge: (mergeInput) => ({
allPassed: mergeInput.results.every(r => r.passed),
results: mergeInput.results
})
};

Type Parameters​

TInput​

TInput

TOutput​

TOutput

TProcessors​

TProcessors extends ParallelProcessors = ParallelProcessors

Properties​

input?​

optional input?: (data) => any

Defined in: packages/core/src/pipeline/types.ts:198

Optional input transformation before fanning out to processors

Parameters​

data​

TInput

Returns​

any


merge?​

optional merge?: (mergeInput) => TOutput

Defined in: packages/core/src/pipeline/types.ts:201

Merges the branch results into the step's output (default: results unchanged).

Parameters​

mergeInput​

ParallelMergeInput<ParallelResults<TProcessors>, TInput, any>

Returns​

TOutput


processors​

processors: TProcessors

Defined in: packages/core/src/pipeline/types.ts:195

Processors to run in parallel. Can be:

  • Object: Named processors with string keys
  • Array: List of processors Functions are auto-wrapped as processables.