How lotusirous/go-concurrency-patterns works
Project Components
• Repository Root: Represent the overall repository as the central container ("Go Concurrency Patterns").
• Individual Pattern Examples: Each numbered directory (for instance, “1-boring”, “2-chan”, “3-generator”, etc.) should be depicted as its own component/module. For patterns that have both client and server files (like “16-context”), show the internal split (client, server, and main) to emphasize their roles.
• Shared Dependencies: Although not explicit beyond using Go’s standard libraries, you might include a node for the Go runtime / standard library to indicate that all examples rely on Go’s concurrency primitives (goroutines, channels, context, etc.).
Grouping and Categorizing
• By Complexity/Type (optional): Consider clustering examples into “Basic Patterns” (1-boring, 2-chan, 3-generator, etc.), “Pattern Compositions” (4-fanin, 5-restore-sequence, 6-select-timeout, etc.), and “Advanced Patterns” (13-adv-pingpong, 14-adv-subscription, 15-bounded-parallelism, 16-context, 17-ring-buffer-channel, 18-worker-pool, etc.). This helps to quickly see which examples build upon simpler patterns versus those that demonstrate more complex scenarios.
Architectural Patterns and Design Principles
• That each directory is focused on a particular concurrency model or pattern (e.g., “fan in/fan out”, “worker pool”, “context cancellation”, etc.).
• That the examples are designed to demonstrate how data flows between goroutines and channels, along with proper signal handling and cancellation.