conc - better structured concurrency for go
last updated: Oct 20, 2023
https://github.com/sourcegraph/conc
conc
is your toolbelt for structured concurrency in go, making common tasks easier and safer.
The main goals of the package are:
- Make it harder to leak goroutines
- Handle panics gracefully
- Make concurrent code easier to read
In
conc
, the owner of a goroutine is always aconc.WaitGroup
. Goroutines are spawned in aWaitGroup
with(*WaitGroup).Go()
, and(*WaitGroup).Wait()
should always be called before theWaitGroup
goes out of scope.
references Go statement considered harmful in the README 😍
cf flowmatic, which looks nicer but I've never used either