MCPcopy Create free account
hub / github.com/wavetermdev/waveterm / tryReadCh

Function tryReadCh

pkg/jobmanager/cirbuf.go:173–180  ·  view source on GitHub ↗
(ch <-chan T)

Source from the content-addressed store, hash-verified

171}
172
173func tryReadCh[T any](ch <-chan T) (*T, bool) {
174 select {
175 case rtn := <-ch:
176 return &rtn, true
177 default:
178 return nil, false
179 }
180}
181
182func (cb *CirBuf) tryWakeWriter() {
183 if waiterCh, ok := tryReadCh(cb.waiterChan); ok {

Callers 1

tryWakeWriterMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected