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

Method callbacker

stream/stream.go:121–136  ·  view source on GitHub ↗

callbacker is responsible for calling the returned callbacks in the order they were submitted. There is only a single instance of callbacker running.

()

Source from the content-addressed store, hash-verified

119// callbacker is responsible for calling the returned callbacks in the order
120// they were submitted. There is only a single instance of callbacker running.
121func (s *Stream) callbacker() {
122 var panicCatcher panics.Catcher
123 defer panicCatcher.Repanic()
124
125 // For every scheduled task, read that tasks channel from the queue.
126 for callbackCh := range s.queue {
127 // Wait for the task to complete and get its callback from the channel.
128 callback := <-callbackCh
129
130 // Execute the callback (with panic protection).
131 panicCatcher.Try(callback)
132
133 // Return the channel to the pool of unused channels.
134 putCh(callbackCh)
135 }
136}
137
138type callbackCh chan func()
139

Callers

nothing calls this directly

Calls 3

RepanicMethod · 0.95
TryMethod · 0.95
putChFunction · 0.85

Tested by

no test coverage detected