MCPcopy Create free account
hub / github.com/facebook/time / popAllQueue

Method popAllQueue

cmd/ziffy/node/sender_linux.go:154–164  ·  view source on GitHub ↗

Insert late packets into corresponding path Fixes the scenario in which packets arrive after traceRoute finished

(routes []*PathInfo)

Source from the content-addressed store, hash-verified

152// Insert late packets into corresponding path
153// Fixes the scenario in which packets arrive after traceRoute finished
154func (s *Sender) popAllQueue(routes []*PathInfo) {
155 for i := 0; i < len(routes); i++ {
156 for len(s.inputQueue[i]) > 0 {
157 sw := <-s.inputQueue[i]
158 if routes[sw.routeIdx] == nil {
159 continue
160 }
161 routes[sw.routeIdx].switches = append(routes[sw.routeIdx].switches, *sw)
162 }
163 }
164}
165
166func sortSwitchesByHop(swArray []SwitchTrafficInfo) {
167 sort.Slice(swArray, func(i, j int) bool {

Callers 2

StartMethod · 0.95
TestPopAllQueueFunction · 0.95

Calls

no outgoing calls

Tested by 1

TestPopAllQueueFunction · 0.76