{"repo":"sourcegraph/conc","free":true,"listed":false,"github":"https://github.com/sourcegraph/conc","clone":"git clone https://github.com/sourcegraph/conc.git","description":"Better structured concurrency for go","language":"Go","stars":10423,"topics":["go","golang","concurrency","goroutines"],"license":"MIT","category":"dev-tools","readme_excerpt":"conc : better structured concurrency for go conc is your toolbelt for structured concurrency in go, making common tasks easier and safer. At a glance - Use conc.WaitGroup if you just want a safer version of sync.WaitGroup - Use pool.Pool if you want a concurrency-limited task runner - Use pool.ResultPool if you want a concurrent task runner that collects task results - Use pool.(Result)?ErrorPool if your tasks are fallible - Use pool.(Result)?ContextPool if your tasks should be canceled on failure - Use stream.Stream if you want to process an ordered stream of tasks in parallel with serial callbacks - Use iter.Map if you want to concurrently map a slice - Use iter.ForEach if you want to concurrently iterate over a slice - Use panics.Catcher if you want to catch panics in your own goroutines All pools are created with pool.New() or pool.NewWithResults[T ](https://pkg.go.dev/github.com/sourcegraph/conc/pool#NewWithResults), then configured with methods: - p.WithMaxGoroutines() configures the maximum number of goroutines in the pool - p.WithErrors() configures the pool to run tasks that return errors - p.WithContext(ctx) configures the pool to run tasks that should be canceled on first error - p.WithFirstError() configures error pools to only keep the first returned error rather than an aggregated error - p.WithCollectErrored() configures result pools to collect results even when the task errored Goals The main goals of the package are: 1) Make it harder to leak goroutines 2) Ha","default_branch":null,"files":null,"tree":[],"storefront":"/r/sourcegraph","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/sourcegraph/conc/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}