Skip to content

Examples Suite Registry

Jignesh Satam edited this page Sep 15, 2026 · 2 revisions

๐Ÿ“‚ Examples Suite Registry

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.


๐Ÿ—‚๏ธ Example Directory Map

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.

๐Ÿƒ Execution Commands

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

๐Ÿ“„ Detailed Breakdown

1. Pure Onboarding (01_basic)

  • 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 ProcessSlice utility completely eliminates.

2. Signature Cheat-Sheet (02_variations)

  • 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 ProcessSlice and FromSlice utilities natively inherit these exact same lexical closure-wrapping rules.

3. Enterprise Streaming (03_advanced_pipeline)

  • 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 FromSlice to create an isolated, context-aware stream that safely tears down on parent timeouts to prevent goroutine leaks.
    • Setting StopOnError: false to allow the pipeline to overlook isolated network rejections and keep syncing remaining rows under heavy load.

๐Ÿ“– Documentation Home

๐Ÿ› ๏ธ Core Guides

๐Ÿ›ก๏ธ Resilience & Safety

๐ŸŽจ Reference Sheets

Clone this wiki locally