MCPcopy
hub / github.com/dgraph-io/dgraph / drainApplyChan

Method drainApplyChan

worker/draft.go:1283–1299  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1281}
1282
1283func (n *node) drainApplyChan() {
1284 numDrained := 0
1285 for {
1286 select {
1287 case entries := <-n.applyCh:
1288 numDrained += len(entries)
1289 for _, entry := range entries {
1290 key := binary.BigEndian.Uint64(entry.Data[:8])
1291 n.Proposals.Done(key, nil)
1292 n.Applied.Done(entry.Index)
1293 }
1294 default:
1295 glog.Infof("Drained %d proposals\n", numDrained)
1296 return
1297 }
1298 }
1299}
1300
1301const tickDur = 100 * time.Millisecond
1302

Callers 1

RunMethod · 0.95

Calls 2

InfofMethod · 0.80
DoneMethod · 0.45

Tested by

no test coverage detected