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

Method dataDeliveryLoop

cmd/test-streammanager/deliverypipe.go:161–182  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

159}
160
161func (dp *DeliveryPipe) dataDeliveryLoop() {
162 defer dp.wg.Done()
163 dp.deliveryLoop(
164 func() *[]taggedPacket { return &dp.dataPending },
165 func(pkt taggedPacket) {
166 if dp.dataTarget != nil {
167 // Track out-of-order packets
168 if dp.metrics != nil && dp.lastDataSeqNum != -1 {
169 if pkt.dataPk.Seq < dp.lastDataSeqNum {
170 dp.metrics.AddOOOPacket()
171 }
172 }
173 dp.lastDataSeqNum = pkt.dataPk.Seq
174 dp.dataTarget(pkt.dataPk)
175
176 dp.lock.Lock()
177 dp.currentBytes -= int64(pkt.dataSize)
178 dp.lock.Unlock()
179 }
180 },
181 )
182}
183
184func (dp *DeliveryPipe) ackDeliveryLoop() {
185 defer dp.wg.Done()

Callers 1

StartMethod · 0.95

Calls 2

deliveryLoopMethod · 0.95
AddOOOPacketMethod · 0.80

Tested by

no test coverage detected