Behavior Of Channels
summary
Claim: treat channels as signaling not queues. Concrete build: a logger type using a buffered channel (capacity 10), a worker goroutine, and a WaitGroup; ten goroutines send strings to the channel while an IO device sometimes blocks. The send uses select with a default drop-on-full branch so writers never block; blocked device only stalls the logger goroutine. Result: service keeps streaming, logs are dropped under pressure and resume when the device recovers.
AI-written summary · about
chapters (6)
- 0:00Introduction
- 1:03Logging shutdown issue
- 3:07Buffered channel solution
- 8:23Logger API and stop method
- 10:10Working logger demo
- 11:57Key takeaways








