MCPcopy Index your code
hub / github.com/coder/coder / Go

Method Go

aibridge/utils/concurrent_group.go:23–33  ·  view source on GitHub ↗
(fn func() error)

Source from the content-addressed store, hash-verified

21}
22
23func (c *ConcurrentGroup) Go(fn func() error) {
24 c.wg.Add(1)
25 go func() {
26 defer c.wg.Done()
27 if err := fn(); err != nil {
28 c.errsMu.Lock()
29 c.errs = multierror.Append(c.errs, err)
30 c.errsMu.Unlock()
31 }
32 }()
33}
34
35func (c *ConcurrentGroup) Wait() error {
36 c.wg.Wait()

Callers 15

TestConcurrentGroupFunction · 0.95
BenchmarkConcurrentGroupFunction · 0.95
InitMethod · 0.95
ShutdownMethod · 0.95
externalAuthByIDMethod · 0.80
workspaceDataMethod · 0.80
workspaceAgentMethod · 0.80
insightsTemplatesMethod · 0.80
TestPaginatedUsersFunction · 0.80
prInsightsMethod · 0.80
workspaceBuildsDataMethod · 0.80

Calls 5

AddMethod · 0.65
DoneMethod · 0.45
LockMethod · 0.45
AppendMethod · 0.45
UnlockMethod · 0.45

Tested by 15

TestConcurrentGroupFunction · 0.76
BenchmarkConcurrentGroupFunction · 0.76
TestPaginatedUsersFunction · 0.64
TestConcurrencyFunction · 0.64
TestMigrateFunction · 0.64
TestStreamStateCollectorFunction · 0.64