MCPcopy Index your code
hub / github.com/sourcegraph/conc / ExamplePool

Function ExamplePool

pool/pool_test.go:13–27  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

11)
12
13func ExamplePool() {
14 p := New().WithMaxGoroutines(3)
15 for i := 0; i < 5; i++ {
16 p.Go(func() {
17 fmt.Println("conc")
18 })
19 }
20 p.Wait()
21 // Output:
22 // conc
23 // conc
24 // conc
25 // conc
26 // conc
27}
28
29func TestPool(t *testing.T) {
30 t.Parallel()

Callers

nothing calls this directly

Calls 4

NewFunction · 0.70
WithMaxGoroutinesMethod · 0.45
GoMethod · 0.45
WaitMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…