transferum
    Preparing search index...

    Class OperatorPipelineBuilder<TFlow>

    Builder for constructing operator pipelines (OperatorPipeline).

    Purpose: Creates a PipelineOperator — a sequential chain of operators, where the output of each previous operator becomes the input of the next.

    Pipeline structure: Operator<T0, T1> -> Operator<T1, T2> -> ... -> Operator<Tn-1, Tn>

    Where:

    • Operator<TInput, TOutput> — operator with strict input/output types
    • TFlow — tuple of types [T0, T1, T2, ..., Tn] representing the entire pipeline

    Mechanics:

    1. create() — creates an empty builder
    2. add(operator) — adds an operator to the chain with type checking:
      • For an empty builder: accepts any Operator<TInput, TOutput>
      • For a filled builder: requires Operator<Last, TNext>
    3. build() — creates a PipelineOperator from the accumulated operators

    Data types:

    • TFlow — tuple of data flow types through the pipeline
    • First — input type of the first operator
    • Last — output type of the last operator

    Difference from Input/Output/DuplexPipelineBuilder:

    • Works with OperatorInterface, not TransferInterface
    • Does not use linkTransfers() — operators execute sequentially
    • Does not create a composite transfer — returns PipelineOperator
    • No owned resource management — operators are not destroyed automatically

    Use cases:

    • Sequential data transformation through a chain of functions
    • Building ETL pipelines (Extract-Transform-Load)
    • Composition of pure functions with typing
    const operator = OperatorPipelineBuilder
    .create()
    .add(new MapOperator<number, string>(x => x.toString()))
    .add(new FilterOperator<string>(s => s.length > 0))
    .add(new ParseOperator<string, number>(s => parseInt(s, 10)))
    .build();

    const result = operator.apply(42);

    Type Parameters

    • TFlow extends readonly unknown[]

      — tuple of types [TInput0, TOutput1, TOutput2, ..., TOutputN]

    Implements

    Index