4 ms·
Also having stuff like a concurrency limiter (instead of doing weird var limiter chan struct{} and using it as `limiter <- struct{}{}` and `defer <-limiter`) as
by nasretdinov 2mo ago
Also having stuff like a concurrency limiter (instead of doing weird var limiter chan struct{} and using it as `limiter <- struct{}{}` and `defer <-limiter`) as a library function in `sync` package would be great too.
- aatd86 2mo agoBut I guess the issue is that oftentimes, it is more of a distributed system coordination issue? What use case do you have in mind?
- arccy 2mo agothere's https://pkg.go.dev/golang.org/x/time/rate https://pkg.go.dev/golang.org/x/time/rate ...
- astonex 2mo agoThere is actually a way to do this with errgroup provided you can work with func() error signature https://pkg.go.dev/golang.org/x/sync/errgroup#Group.SetLimit https://pkg.go.dev/golang.org/x/sync/errgroup#Group.SetLimit
- inigyou 2mo agoError 403. Summarize?
- theowaway213456 2mo agoerrgroup has a SetLimit function to control the max number of concurrent go routines running at once.