Repository navigation
Add a unix pipes example - #73
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_pipesturns 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 runsargvwithos/exec, feeding its inputs to stdin in port-name order (which also orders the report sections) aftercomponent.RequireInputshas 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