Different pipes. One standard.

Type to search this site.

Search runs in your browser against a static index built with this site (Pagefind). Nothing you type is sent to a server.

Can two things read the same output?

Available — v0.0.1 (experimental)starlark

Branch without running twice

One lowercase step feeds two consumers. It runs once; both get every record.

Available in v0.0.1: the files, README and tests are in examples/email/normalize-and-mask-email-branching of the openflange-go repository. Commands run from the repository root.

Needs: only the openflange CLI.

A pipe is a data-processing step with declared inputs and outputs.

Branching: the lowercase pipe runs once and its text output is consumed twice — by mask-email, which feeds the output named masked, and directly by the output named normalized.input: emaillowercaseruns oncetextmask-emailemailemailoutput: maskedoutput: normalized
Branching: the lowercase pipe runs once and its text output is consumed twice — by mask-email, which feeds the output named masked, and directly by the output named normalized.input: emaillowercaseruns oncetextmask-emailemailemailoutput:maskedoutput:normalized
Two consumers reference the same output. That is a broadcast: lowercase runs once, and both get every record.

What goes in, what comes out

Input (stdin)
"Alice@Example.COM"
Command
printf '"Alice@Example.COM"\n' | openflange run ./examples/email/normalize-and-mask-email-branching --output masked=masked.ndjson --output normalized=-
Outputs
# normalized (stdout)
"alice@example.com"
# masked.ndjson
"a***e@example.com"

Files and further commands

examples/email/normalize-and-mask-email-branching/pipeline.yaml
# Branching variant: lowercase.outputs.text has two consumers (broadcast).
spec: openflange.org/pipeline/v0.1
nodes:
  lowercase:
    pipe: ../pipes/lowercase
    inputs:
      text: {from: inputs.email}
  mask:
    pipe: ../pipes/mask-email
    inputs:
      email: {from: lowercase.outputs.text}
outputs:
  masked: {from: mask.outputs.email}
  normalized: {from: lowercase.outputs.text}
  rejected: {from: mask.outputs.rejected}

What to notice

  • There is no connections section and nothing to configure on the producer. A consumer names the output it reads; a second consumer naming the same output makes it a broadcast.
  • The slowest consumer sets the pace. Buffers are bounded, so a slow branch slows the producer instead of filling memory.
  • The third output, rejected, is optional: the command above leaves it unbound, so an invalid address would fail the run. Bind it with --output rejected=rejected.ndjson to keep the run alive.
  • The opposite case — two producers into one input — is never implicit. Add an explicit std:merge node.
  • This directory has no README of its own in the repository: the command is the one shown by openflange help run, and the output is from a run of the source build.