This repository provides idiomatic Go patterns for concurrency, including graceful shutdown, worker pools, retry logic, and error handling. Each example is paired with a Mermaid sequence diagram for clarity.
- Graceful shutdown with
contextandWaitGroup - Signal handling for clean exits
- Worker pool implementation with dynamic tasks
- Retry logic with safe channel operations
- Timeout-based shutdown
- Error handling and logging
- Visual sequence diagrams with channels as actors
- For unbuffered channel
- Send to channel
ch <- true, must have a matching receive<-chhappening at the same time. If not it will be blocked on send. Because it doesn't have storage capacity.
- Send to channel