Skip to content

Add a unix pipes example - #73

Merged
hovsep merged 1 commit into
mainfrom
claude/project-thread-mhr3ml
Oct 5, 2026
Merged

hovsep merged 1 commit into
mainfrom
claude/project-thread-mhr3ml

Conversation

@hovsep

@hovsep hovsep commented Oct 5, 2026

Copy link
Copy Markdown
Owner

Requested by ovsep · project thread

Before: no example ran external processes, and the only pipeline example (basics/pipeline) is a straight in-process chain.

After: patterns/unix_pipes turns a shell job into a mesh of 18 components, each a real unix command (cat, wc, cut, sort, uniq, head, awk). One access log is read from stdin once (it blocks for typed input, or takes < access.log), fanned out into three branches that run side by side, and joined into one report. The run prints which commands ran in each cycle, so the concurrency and the join waiting for the longest branch are visible.

How: a generic newCommand(name, argv, inputs...) component runs argv with os/exec, feeding its inputs to stdin in port-name order (which also orders the report sections) after component.RequireInputs has all of them. A non-zero exit fails the job with the command's stderr. The README compares it with the equivalent bash (tee, process substitution, temp files). Includes a test that checks the report for the sample log, the generated graph, and a row in the root README.

Closes #27

🤖 Generated with Claude Code

https://claude.ai/code/session_01WbQCnCrtf3EqpxJD24koiW


Generated by Claude Code

Every component runs a real unix command; one access log is read from
stdin once, analysed three ways concurrently and joined into a report.

Closes #27

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WbQCnCrtf3EqpxJD24koiW
@hovsep hovsep self-assigned this Oct 5, 2026
@hovsep
hovsep merged commit 4e1148c into main Oct 5, 2026
2 checks passed
@hovsep
hovsep deleted the claude/project-thread-mhr3ml branch October 5, 2026 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[example] Unix piping

2 participants