Pack Union avatar

Pack Union

1 version
Open in App

Pack union

Combines multiple input streams into a single union-type stream, where each value retains its original type.

Use this when

  • Multiple sources produce related but distinct types that should be processed uniformly downstream.
  • You are unifying multi-format inputs (e.g. image variants) before a format-agnostic consumer.
  • You need a single stream slot downstream but have several typed producers upstream.

What it does

Consumes messages from each input and emits them as-is onto a single stream whose type is the union of input types. Inputs Image.BGR, Image.GRAY, Image.RGB all feed into a single Image.BGR | Image.GRAY | Image.RGB output.

Inputs

TypeDescription
$ts...One input stream per union variant.

Outputs

TypeDescription
$ts| ...A union-typed stream carrying all variants.

Parameters

This transformation takes no parameters.

Works best with

  • A downstream component that accepts a union and dispatches on the active variant.
  • Unpack union — natural inverse.

Caveats

  • Values retain their original type at runtime — ensure downstream logic dispatches rather than assumes a concrete type.
  • Only one input produces each output message; the ordering is interleaved by arrival.

Versions

  • 25fe570ddefaultlatestlinuxTransformation