transferum
    Preparing search index...

    Class InputPipelineBuilder<TCurrent, TStartTransfer>

    Use CompositeTransferBuilder instead. Will be removed in the next major release.

    Builder for constructing input pipelines (InputPipeline).

    Purpose: Creates a composite transfer with an input interface (InputCompositeTransfer), which accepts data from outside and passes it through a chain of intermediate duplex transfers to the final input transfer.

    Pipeline structure: TStartTransfer [-> DuplexTransfer -> ... ->] -> InputTransfer │ │ │ └─ start() └─ to() └─ finish()

    Where:

    • TStartTransfer — initial duplex transfer (must be DuplexTransfer)
    • DuplexTransfer — intermediate chain links (optional, via to())
    • InputTransfer — final transfer (PushableTransferInterface | InputPollingTransferInterface)

    Mechanics:

    1. start(startTransfer) — creates a builder with the initial transfer
    2. to(nextTransfer, owned?) — adds an intermediate duplex transfer to the chain, linking it to the previous one via linkTransfers()
    3. finish(lastTransfer, options?) — completes the pipeline, creating a UniversalCompositeTransfer

    finish() options:

    • triggerable?: TriggerableInterface — explicit trigger for the composite
    • gate?: GateInterface — explicit gate for flow control
    • owned?: boolean — whether to destroy lastTransfer on composite destroy()

    The owned parameter in to():

    • owned = true — the intermediate transfer is added to the owned resources array and will be destroyed on composite destroy()
    • owned = false (default) — the transfer is not destroyed automatically

    Data types:

    • TStart — data type of the initial transfer (inferred automatically)
    • TCurrent — data type of the current chain link (changes after each to())
    • Composite input type = InputTransferDataType

    Use cases:

    • Building a reactive data processing pipeline
    • Chain of transformations with automatic subscription management
    • Creating input nodes for pipeline architecture
    const pipeline = InputPipelineBuilder
    .start(new PushStoredChannelTransfer<number>())
    .to(new ConditionTransfer<number>(x => x > 0))
    .to(new BufferTransfer<number>())
    .finish(new GateTransfer<number>({ activated: true, initialValue: 0 }), {
    owned: true
    });

    pipeline.push(42);
    pipeline.destroy();

    Type Parameters

    • TCurrent

      — data type of the current chain link

    • TStartTransfer extends InputTransfer<unknown>

      — type of the initial transfer (must be InputTransfer)

    Implements

    Index