Registry / utility / remeh-sizedwaitgroup

remeh-sizedwaitgroup

JSON →
library1.0.0gogounverified

Package sizedwaitgroup adds the feature of limiting the maximum number of concurrently started goroutines.

go get github.com/remeh/sizedwaitgroup
INSTALL
IMPORT
SIG · REMEH-SIZEDWAITGRO
R
remeh-sizedwaitgroup
utilitygov1.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

sizedwaitgroup
github.com/remeh/sizedwaitgroup

Run goroutines with a concurrency limit

package main import ( "fmt" "sync" "github.com/remeh/sizedwaitgroup" ) func main() { swg := sizedwaitgroup.New(5) for i := 0; i < 10; i++ { swg.Add() go func(i int) { defer swg.Done() fmt.Println(i) }(i) } swg.Wait() }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
1.0.0latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
10 hits · last 30 days
node
10
Resources
remeh-sizedwaitgroup — go get remeh-sizedwaitgroup · libregistry