MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / Enqueue

Method Enqueue

pkg/utilds/workqueue.go:23–37  ·  view source on GitHub ↗
(item T)

Source from the content-addressed store, hash-verified

21}
22
23func (wq *WorkQueue[T]) Enqueue(item T) bool {
24 wq.lock.Lock()
25 defer wq.lock.Unlock()
26 if wq.closed {
27 return false
28 }
29 if !wq.started {
30 wq.started = true
31 wq.wg.Add(1)
32 go wq.worker()
33 }
34 wq.queue = append(wq.queue, item)
35 wq.cond.Signal()
36 return true
37}
38
39func (wq *WorkQueue[T]) worker() {
40 defer wq.wg.Done()

Callers 4

SendAckMethod · 0.80
SendDataMethod · 0.80
RecvDataMethod · 0.80
RecvAckMethod · 0.80

Calls 1

workerMethod · 0.95

Tested by

no test coverage detected