Skip to content

Commit 1fac6fb

Browse files
committed
WithQueueLen exmaple
1 parent 4b3415c commit 1fac6fb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

_examples/stress/main.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@ func main() {
2929
}
3030
var wg sync.WaitGroup
3131
// passed wg will be accounted at p.Wait() call
32-
p := mpb.New(mpb.WithWaitGroup(&wg), mpb.WithDebugOutput(os.Stderr))
32+
p := mpb.New(
33+
mpb.WithWaitGroup(&wg),
34+
mpb.WithDebugOutput(os.Stderr),
35+
mpb.WithQueueLen(totalBars), // totalBars is known ahead of time so overriding default queue len is good idea
36+
)
3337
wg.Add(totalBars)
3438

3539
for i := 0; i < totalBars; i++ {

0 commit comments

Comments
 (0)