transferum
    Preparing search index...

    Class OutputPipelineBuilder

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

    Builder for constructing output pipelines (OutputPipeline).

    Purpose: Creates a composite transfer with an output interface (OutputCompositeTransfer), which extracts data from the initial output transfer and passes it through a chain of intermediate duplex transfers to the final transfer.

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

    Where:

    • OutputTransfer — initial output transfer (PullableTransferInterface | SubscribableTransferInterface | GateTransferInterface)
    • DuplexTransfer — intermediate chain links (optional, via to())
    • TFinishTransfer — final duplex transfer

    Mechanics:

    1. start(startTransfer) — creates a builder with the initial output 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:

    • Composite output type = OutputTransferDataType

    Use cases:

    • Building a pipeline for extracting data from an external source
    • Chain of transformations with polling or subscribable source
    • Creating output nodes for pipeline architecture
    const pipeline = OutputPipelineBuilder
    .start(new GateTransfer<number>({ activated: true, initialValue: 0 }))
    .to(new PushStoredChannelTransfer<number>())
    .finish(new PushStoredChannelTransfer<number>(), {
    owned: true
    });

    pipeline.subscribe(data => console.log(data));
    pipeline.destroy();

    Implements

    Index
    • Adds an intermediate duplex transfer to the pipeline chain.

      Mechanics:

      1. Links the current transfer to nextTransfer via linkTransfers()
      2. Creates a DisposableSubscriberAdapter to manage the subscription
      3. Adds the adapter (and optionally nextTransfer) to the owned resources array
      4. Returns a new builder with the updated chain

      Parameters

      • nextTransfer: DuplexTransfer<unknown, unknown>

        — duplex transfer to add to the chain

      • Optionalowned: boolean

        — if true, nextTransfer will be destroyed on composite destroy()

      Returns OutputPipelineBuilderInterface

      A new builder to continue the chain