We build actors from goroutines and channels: one goroutine owns its state and handles its mailbox one message at a time, with asks, tells, clean stops and restarts after a crash.
Mahdi.Kh
November 23, 2026
We learn how a semaphore caps how many goroutines do expensive work at once, build one from a buffered channel, and use the same idea for connection pools.
Mahdi.Kh
November 23, 2026
We learn how a rate limiter decides how often requests may go through, build a token bucket and per-client limiters, and see when to wait and when to answer 429.
Mahdi.Kh
November 23, 2026
We see how a circuit breaker stops a failing dependency from dragging our service down, and build one with three states that many goroutines can share.
Mahdi.Kh
November 23, 2026
We learn to treat a context as the cancellation tree of one request: passing it through every layer and goroutine, tightening deadlines, cancelling with a cause, and avoiding the leaks.
Mahdi.Kh
November 23, 2026
We learn to run setup exactly once, on first use, with sync.Once and OnceValue, see why a hand-rolled nil check races, and build a lazy value that retries after a failure.
Mahdi.Kh
November 23, 2026
We learn to wait for a group of goroutines with sync.WaitGroup, collect their results and errors safely, stop at the first error, and avoid the mistakes that end in a deadlock.
Mahdi.Kh
November 23, 2026
We see how a data race loses updates, catch one with the race detector, fix it with a mutex, and learn when RWMutex and atomics help and how to keep locks short.
Mahdi.Kh
November 23, 2026
We build a pool of a fixed number of goroutines that share one queue of jobs, shut it down cleanly, stop it with a context and learn how many workers to start.
Mahdi.Kh
November 23, 2026
We learn how one goroutine asks another a question over channels and gets its own answer back, with timeouts on both sides, and where futures fit in.
Mahdi.Kh
November 23, 2026