Repository navigation
Examples Suite Registry
Jignesh Satam edited this page Sep 15, 2026
·
2 revisions
The concur repository is structured with a progressive, step-by-step learning path. This registry serves as a map for all built-in runnable examples, ranging from simple onboarding routines to production-grade streaming pipelines.
| Directory | Target Complexity | Core Architecture Patterns |
|---|---|---|
| 01_basic | ๐ข Beginner | Compares input channel management (Process) against the new ProcessSlice abstraction. |
| 02_variations | ๐ก Intermediate | Master reference sheet for matching 12 distinct closure styles and external state dependencies. |
| 03_advanced_pipeline | ๐ฅ Advanced | Multi-stage orchestration transforming static database collections into context-aware streams via FromSlice. |
You can run any of these scenarios directly from the root directory of your workspace without any extra configuration.
# Run the entry onboarding tutorial
go run ./examples/01_basic/main.go
# Run the 12-signature adapter reference cheat-sheet
go run ./examples/02_variations/main.go
# Run the complex multi-stage streaming pipeline
go run ./examples/03_advanced_pipeline/main.go- Objective: Takes a collection of sequential integers, distributes them across parallel worker pools to calculate their squares, and aggregates the fanned-in stream.
-
Why it matters: It serves as a side-by-side transition guide. It shows the exact lines of boilerplate code (channel allocation, buffer tracking, manual seeding, explicit closures) that your new
ProcessSliceutility completely eliminates.
-
Objective: A bulletproof guide demonstrating how to adapt legacy, un-contextualized, or side-effect-only functions (
func(),func(In) error, etc.) into the pipeline. -
Why it matters: It proves to developers that they don't need dozens of complex method overloads. It also includes specific Bonus Sections showing how your brand-new
ProcessSliceandFromSliceutilities natively inherit these exact same lexical closure-wrapping rules.
- Objective: Simulates a real-world infrastructure taskโsyncing a static array of database logs or orders out to an external billing API service.
-
Why it matters: It shows production best practices in action:
- Using
FromSliceto create an isolated, context-aware stream that safely tears down on parent timeouts to prevent goroutine leaks. - Setting
StopOnError: falseto allow the pipeline to overlook isolated network rejections and keep syncing remaining rows under heavy load.
- Using