Skip to content

Commit

Permalink
WithQueueLen exmaple
Browse files Browse the repository at this point in the history
  • Loading branch information
vbauerster committed Jan 3, 2025
1 parent 4b3415c commit 1fac6fb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion _examples/stress/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ func main() {
}
var wg sync.WaitGroup
// passed wg will be accounted at p.Wait() call
p := mpb.New(mpb.WithWaitGroup(&wg), mpb.WithDebugOutput(os.Stderr))
p := mpb.New(
mpb.WithWaitGroup(&wg),
mpb.WithDebugOutput(os.Stderr),
mpb.WithQueueLen(totalBars), // totalBars is known ahead of time so overriding default queue len is good idea
)
wg.Add(totalBars)

for i := 0; i < totalBars; i++ {
Expand Down

0 comments on commit 1fac6fb

Please sign in to comment.