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

Method Wait

stream/stream.go:91–103  ·  view source on GitHub ↗

Wait signals to the stream that all tasks have been submitted. Wait will not return until all tasks and callbacks have been run.

()

Source from the content-addressed store, hash-verified

89// Wait signals to the stream that all tasks have been submitted. Wait will
90// not return until all tasks and callbacks have been run.
91func (s *Stream) Wait() {
92 s.init()
93
94 // Defer the callbacker cleanup so that it occurs even in the case
95 // that one of the tasks panics and is propagated up by s.pool.Wait().
96 defer func() {
97 close(s.queue)
98 s.callbackerHandle.Wait()
99 }()
100
101 // Wait for all the workers to exit.
102 s.pool.Wait()
103}
104
105func (s *Stream) WithMaxGoroutines(n int) *Stream {
106 s.pool.WithMaxGoroutines(n)

Callers 3

ExampleStreamFunction · 0.45
TestStreamFunction · 0.45
BenchmarkStreamFunction · 0.45

Calls 1

initMethod · 0.95

Tested by 3

ExampleStreamFunction · 0.36
TestStreamFunction · 0.36
BenchmarkStreamFunction · 0.36